On Thu, May 6, 2010 at 04:54, Lex Trotman
<elextr@gmail.com> wrote:
there are a couple of things i would like to add to geany:
1) brace balancing - the current behavior is to auto-close a brace with no neighboring closing brace ("{" becomes "{}", but "{{}" remains "{{}" and not "{{}}")
Yes, if any brace is already followed by a matching close (matching after taking into account any following open braces) then an extra isn't added. As you say, that doesn't mean that braces balance in the file, but if they don't balance where do you put the close?? If I have { { } } and I add a brace at position 3 giving { { { } } do I want { {} { } } or do I want { { { } } }?? So the current behaviour of not adding anything other than for level one open braces is probably better.
this unwanted behavior you describe is to some extent already in place in geany - given a string "(...)", when adding a new "(" to the left of the string, scintilla will return -1 for bracematching and so geany will add a ")" automatically, which results in "()(...)". but i may have wanted to produce "((...))".
all the same, the example you gave is a good argument against my suggested change.
for me personally, coupling brace-balancing with allowing users to wrap the current selection in braces (similar to the "comment current line" feature) would be a good solution.
i would like to hear thoughts on the matter.