diff -r -u geany-1.32.orig/src/editor.c geany-1.32.modi/src/editor.c --- geany-1.32.orig/src/editor.c 2017-11-19 12:45:42.000000001 +0300 +++ geany-1.32.modi/src/editor.c 2018-02-09 00:07:44.623012215 +0300 @@ -100,7 +100,7 @@ static void auto_multiline(GeanyEditor *editor, gint pos); static void auto_close_chars(ScintillaObject *sci, gint pos, gchar c); static void close_block(GeanyEditor *editor, gint pos); -static void editor_highlight_braces(GeanyEditor *editor, gint cur_pos); +static void editor_highlight_braces(GeanyEditor *editor, gint cur_pos, gint cur_virt); static void read_current_word(GeanyEditor *editor, gint pos, gchar *word, gsize wordlen, const gchar *wc, gboolean stem); static gsize count_indent_size(GeanyEditor *editor, const gchar *base_indent); @@ -505,6 +505,7 @@ { ScintillaObject *sci = editor->sci; gint pos = sci_get_current_position(sci); + gint virt = sci_get_cursor_virtual_space(sci); /* since Scintilla 2.24, SCN_UPDATEUI is also sent on scrolling though we don't need to handle * this and so ignore every SCN_UPDATEUI events except for content and selection changes */ @@ -515,7 +516,7 @@ ui_update_popup_reundo_items(editor->document); /* brace highlighting */ - editor_highlight_braces(editor, pos); + editor_highlight_braces(editor, pos, virt); ui_update_statusbar(editor->document, pos); @@ -3407,7 +3408,7 @@ GeanyDocument *doc = document_get_current(); GeanyEditor *editor; gint brace_pos = GPOINTER_TO_INT(user_data); - gint end_pos, cur_pos; + gint end_pos, cur_pos, cur_virt; brace_timeout_active = FALSE; if (!doc) @@ -3415,7 +3416,10 @@ editor = doc->editor; cur_pos = sci_get_current_position(editor->sci) - 1; + cur_virt = sci_get_cursor_virtual_space(editor->sci); + if (cur_virt > 0) + return FALSE; if (cur_pos != brace_pos) { cur_pos++; @@ -3423,13 +3427,13 @@ { /* we have moved past the original brace_pos, but after the timeout * we may now be on a new brace, so check again */ - editor_highlight_braces(editor, cur_pos); + editor_highlight_braces(editor, cur_pos, 0); return FALSE; } } if (!utils_isbrace(sci_get_char_at(editor->sci, brace_pos), editor_prefs.brace_match_ltgt)) { - editor_highlight_braces(editor, cur_pos); + editor_highlight_braces(editor, cur_pos, 0); return FALSE; } end_pos = sci_find_matching_brace(editor->sci, brace_pos); @@ -3450,13 +3454,15 @@ } -static void editor_highlight_braces(GeanyEditor *editor, gint cur_pos) +static void editor_highlight_braces(GeanyEditor *editor, gint cur_pos, gint cur_virt) { gint brace_pos = cur_pos - 1; SSM(editor->sci, SCI_SETHIGHLIGHTGUIDE, 0, 0); SSM(editor->sci, SCI_BRACEBADLIGHT, (uptr_t)-1, 0); + if (cur_virt > 0) + return; if (! utils_isbrace(sci_get_char_at(editor->sci, brace_pos), editor_prefs.brace_match_ltgt)) { brace_pos++;