[Geany-devel] Autoclose mismatches
Lex Trotman
elextr at xxxxx
Wed Feb 2 21:05:59 UTC 2011
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
More information about the Devel
mailing list