GNOME Bugzilla – Bug 768459
indenter-c: Allow multi-line conditions to end a line with ')'
Last modified: 2016-07-06 02:55:48 UTC
See commit message.
Created attachment 330918 [details] [review] indenter-c: Allow multi-line conditions to end a line with ')' Currently the indenter assumes that a condition is complete if one of its lines ends with a matched ')'. If for some reason you want to end a line with ')' but not end the condition, the auto indenting would be wrong. This commit fixes that by checking for an unmatched '(' when a line ends with ')'.
Review of attachment 330918 [details] [review]: Seems fine, just a quick nit. Rewriting indenters is still on my list for 3.22 (after we get a few other things in place). So while fixes to the indenter are useful, they may be somewhat short lived. Feel free to commit with the nit fixed. ::: plugins/c-pack/ide-c-indenter.c @@ -644,2 +641,2 @@ */ - if ((ch != ')') && backward_find_matching_char (iter, ')')) + GtkTextIter copy = *iter; Declarations always belong at the top of a scope/block/etc for the Builder code-base.
Pushed as commit c80d3d726937b730da920964d871a427976486f2