From a7b211d66f192e5da14e36f6b64f6d1241025d00 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Mon, 15 Sep 2008 12:49:51 +0000 Subject: [PATCH] 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 --- ChangeLog | 3 +++ src/editor.c | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 44eb3a1e..e691f101 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/src/editor.c b/src/editor.c index 18a87ef5..7fd80435 100644 --- a/src/editor.c +++ b/src/editor.c @@ -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); + } }