After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 688610 - Indentation incorrect if opening brace is in a line with other characters before it
Indentation incorrect if opening brace is in a line with other characters bef...
Status: RESOLVED FIXED
Product: anjuta
Classification: Applications
Component: plugins: language-support-vala
git master
Other Linux
: Normal normal
: ---
Assigned To: Abderrahim Kitouni
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2012-11-19 01:38 UTC by Arnel Borja
Modified: 2012-11-24 10:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Expected indentation. (Might be different from default because of my settings) (169 bytes, text/x-vala)
2012-11-19 01:38 UTC, Arnel Borja
  Details
Result (161 bytes, text/x-vala)
2012-11-19 01:47 UTC, Arnel Borja
  Details
indentation-c-style: Fix logic error from e27cade3ec1ce883182ff1b99637d781ae6b128c (1.10 KB, patch)
2012-11-23 18:49 UTC, Carl-Anton Ingmarsson
committed Details | Review

Description Arnel Borja 2012-11-19 01:38:12 UTC
Created attachment 229324 [details]
Expected indentation. (Might be different from default because of my settings)

When the line contains other characters other than the opening bracket (commonly used in Vala and C#), the following lines are not indented correctly; they only have one tab as indentation.

This shows up since the commit e27cade was pushed.

A sample file is attached.

This is actually in the "plugins/indentation-c-style" component.
Comment 1 Arnel Borja 2012-11-19 01:47:33 UTC
Created attachment 229325 [details]
Result
Comment 2 Arnel Borja 2012-11-19 03:23:43 UTC
Forgot to mention that this doesn't always happen. Some blocks in my source codes are correctly indented, though the attached file is one of the smallest that I could find.
Comment 3 Carl-Anton Ingmarsson 2012-11-23 18:49:17 UTC
Created attachment 229740 [details] [review]
indentation-c-style: Fix logic error from e27cade3ec1ce883182ff1b99637d781ae6b128c

We should stop the loop when the number of left braces are more than or equal to the number
of right braces.
Comment 4 Sébastien Granjoux 2012-11-24 10:43:45 UTC
Comment on attachment 229740 [details] [review]
indentation-c-style: Fix logic error from e27cade3ec1ce883182ff1b99637d781ae6b128c

Thank, I have committed it.