Apply patch from Jason Oster to highlight matching brace indent

guides (thanks, #2104099).


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2945 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2008-09-15 12:49:51 +00:00
parent 89ac3b59a4
commit a7b211d66f
2 changed files with 11 additions and 0 deletions

View File

@ -3,6 +3,9 @@
* src/editor.c:
Show ellipsis (...) item when there are too many symbol names for
autocompletion.
* src/editor.c:
Apply patch from Jason Oster to highlight matching brace indent
guides (thanks, #2104099).
2008-09-14 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>

View File

@ -2482,6 +2482,7 @@ void editor_highlight_braces(ScintillaObject *sci, gint cur_pos)
brace_pos++;
if (! utils_isbrace(sci_get_char_at(sci, brace_pos), editor_prefs.brace_match_ltgt))
{
SSM(sci, SCI_SETHIGHLIGHTGUIDE, 0, 0);
SSM(sci, SCI_BRACEBADLIGHT, (uptr_t)-1, 0);
return;
}
@ -2489,9 +2490,16 @@ void editor_highlight_braces(ScintillaObject *sci, gint cur_pos)
end_pos = SSM(sci, SCI_BRACEMATCH, brace_pos, 0);
if (end_pos >= 0)
{
gint col = MIN(sci_get_col_from_position(sci, brace_pos), sci_get_col_from_position(sci, end_pos));
SSM(sci, SCI_SETHIGHLIGHTGUIDE, col, 0);
SSM(sci, SCI_BRACEHIGHLIGHT, brace_pos, end_pos);
}
else
{
SSM(sci, SCI_SETHIGHLIGHTGUIDE, 0, 0);
SSM(sci, SCI_BRACEBADLIGHT, brace_pos, 0);
}
}