[Geany-devel] Autoclose mismatches

Jonathan Daily biomathjdaily at xxxxx
Thu Feb 3 02:05:25 UTC 2011


I have noticed a similar issue that crops up when coding in several
languages. I will start a function call that uses a second function as
an input, and autoclose will take the first ')' as the close for the
nested function call. Notepad++ has a preferences option to autoclose
all brackets/quotes even if matched, and this is something that seems
useful to me for geany.

On Wed, Feb 2, 2011 at 4:05 PM, Lex Trotman <elextr at gmail.com> wrote:
> Hi all,
>
> It was raised in a recent thread and I vaguely remember raising it before.
>
> Autoclose incorrectly counts closes in comments and strings, ie a C
> comment /* humorous blah :-) */
> will match a ( entered before it.
>
> The editor.c/auto_close_char() uses Scintilla SCI_BRACEMATCH which
> checks for the style being the same as the open character or past the
> end of styling.
>
> The auto_close_char() function is called in on_char_added
> notification, which according to Scintilla documentation:
> "This notification is sent before the character has been styled so
> processing that depends on styling should instead be performed in the
> SCN_UPDATEUI notification."
>
> So I suggest auto_close_char() needs to be called from on_update_ui
> like highlight_braces is.
>
> Cheers
> Lex
> _______________________________________________
> Geany-devel mailing list
> Geany-devel at uvena.de
> http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
>



-- 
===============================================
Jon Daily
Technician
===============================================
#!/usr/bin/env outside
# It's great, trust me.



More information about the Devel mailing list