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 688275 - Fixes for paranthesis indentation.
Fixes for paranthesis indentation.
Status: RESOLVED FIXED
Product: anjuta
Classification: Applications
Component: plugins: language-support-c-cpp-java
unspecified
Other All
: Normal normal
: ---
Assigned To: Naba Kumar
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2012-11-13 18:45 UTC by Carl-Anton Ingmarsson
Modified: 2012-11-15 21:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
indentation-c-style: Update preferences UI file to gtk+-3 (9.04 KB, patch)
2012-11-13 18:45 UTC, Carl-Anton Ingmarsson
committed Details | Review
indentation-c-style: Fix modeline in plugin.c (916 bytes, patch)
2012-11-13 18:45 UTC, Carl-Anton Ingmarsson
committed Details | Review
indentation-c-style: Fix get_line_indentation(). (2.62 KB, patch)
2012-11-13 18:45 UTC, Carl-Anton Ingmarsson
committed Details | Review
indentation-c-style: Add option whether paranthesis alignment should only use spaces. (11.63 KB, patch)
2012-11-13 18:45 UTC, Carl-Anton Ingmarsson
committed Details | Review

Description Carl-Anton Ingmarsson 2012-11-13 18:45:33 UTC
The following patches fixes paranthesis indentation which was a bit broken since 166f7f2cb4eaabb4b148841881cccf2855fa081a.
The last patch also adds an option whether to use only spaces for paranthesis indentation (which is the current behavior) or to use as many tabs as possible.
Comment 1 Carl-Anton Ingmarsson 2012-11-13 18:45:36 UTC
Created attachment 228915 [details] [review]
indentation-c-style: Update preferences UI file to gtk+-3
Comment 2 Carl-Anton Ingmarsson 2012-11-13 18:45:39 UTC
Created attachment 228916 [details] [review]
indentation-c-style: Fix modeline in plugin.c

The correct modeline for using spaces is "indent-tabs-mode: nil;" and not
"indent-spaces-mode: t;".
Comment 3 Carl-Anton Ingmarsson 2012-11-13 18:45:42 UTC
Created attachment 228917 [details] [review]
indentation-c-style: Fix get_line_indentation().

get_line_indentation() was broken since 166f7f2cb4eaabb4b148841881cccf2855fa081a. Fix it
by only looking for matching left brace if the current line has a right brace.

Also break on the first line where the number of left braces are more than or equal to the right
braces instead of just breaking on the line where the total number of left and right braces are
equal.
Comment 4 Carl-Anton Ingmarsson 2012-11-13 18:45:45 UTC
Created attachment 228918 [details] [review]
indentation-c-style: Add option whether paranthesis alignment should only use spaces.

This option is by default true. If set to false we indent using as many tabs as possible.
Comment 5 Sébastien Granjoux 2012-11-15 21:04:11 UTC
Comment on attachment 228915 [details] [review]
indentation-c-style: Update preferences UI file to gtk+-3

Thanks for you patch. I have changed the line
<property name="xalign">0.5</property>
to
<property name="xalign">0</property>

I think it's the default in glade 3, but it's wrong the default value in glade2 was 0.
Comment 6 Sébastien Granjoux 2012-11-15 21:04:40 UTC
Comment on attachment 228916 [details] [review]
indentation-c-style: Fix modeline in plugin.c

Thanks.
Comment 7 Sébastien Granjoux 2012-11-15 21:06:26 UTC
Comment on attachment 228918 [details] [review]
indentation-c-style: Add option whether paranthesis alignment should only use spaces.

Thanks for your patch.
Comment 8 Sébastien Granjoux 2012-11-15 21:07:29 UTC
Review of attachment 228917 [details] [review]:

Thanks for your patch. I have committed it without any change.