[Geany-devel] hello (self introduction)

Lex Trotman elextr at xxxxx
Thu May 6 09:16:44 UTC 2010

On 6 May 2010 18:54, Avi Hayoun <iceman400 at gmail.com> wrote:

> 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
> 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.

That would be good.  Could you think about how it would interact with
indentation, any benefit from adding braces quickly would be swiftly lost if
it takes a lot of effort to get the layout right.  And users see a feature
that "always" produces the wrong answer as worse than no feature, they
demand it be fixed :-)

>>> 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.

Yeah, weird.

> kind regards,
> avi
> _______________________________________________
> Geany-devel mailing list
> Geany-devel at uvena.de
> http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/devel/attachments/20100506/335d094a/attachment.html>

More information about the Devel mailing list