[Geany-devel] hello (self introduction)

Avi Hayoun iceman400 at xxxxx
Thu May 6 08:54:38 UTC 2010

On Thu, May 6, 2010 at 04:54, Lex Trotman <elextr at 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
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.

>> i like the use of brace-matching, so i'm not suggesting to make braces
>> close blindly, but am looking into adding a brace-balance calculation
>> function.
> Scanning will have to be done in Scintilla because it has the information
> to ignore braces in strings and comments, so level saving probably should be
> done there as well.

this is true to a limited extent. both in geany 0.18 and in the trunk
version, when 2 matching braces are separated by a 3rd brace in a string or
in a comment, the correct pair are colored as matching. however, if there is
a closing brace in a comment or string and an opening brace is added before
the comment/string, the brace will not auto-close. i think i'll have a look
at this to try and find out why this is happening.

kind regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/devel/attachments/20100506/03346d04/attachment.html>

More information about the Devel mailing list