From 6b0ee515ad22787742d5b1432ce1c517afcdb0b0 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Mon, 27 May 2013 16:34:58 +0400 Subject: [PATCH] mceditor: last_bracket: make member of WEdit. Signed-off-by: Andrew Borodin --- src/editor/edit.c | 7 +++---- src/editor/editwidget.h | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/editor/edit.c b/src/editor/edit.c index f27ec8402..113dcaf2f 100644 --- a/src/editor/edit.c +++ b/src/editor/edit.c @@ -135,8 +135,6 @@ static const struct edit_filters /* *INDENT-ON* */ }; -static off_t last_bracket = -1; - /*** file scope functions ************************************************************************/ /* --------------------------------------------------------------------------------------------- */ @@ -2276,6 +2274,7 @@ edit_init (WEdit * edit, int y, int x, int lines, int cols, const vfs_path_t * f edit->over_col = 0; edit->bracket = -1; + edit->last_bracket = -1; edit->force |= REDRAW_PAGE; /* set file name before load file */ @@ -3517,9 +3516,9 @@ void edit_find_bracket (WEdit * edit) { edit->bracket = edit_get_bracket (edit, 1, 10000); - if (last_bracket != edit->bracket) + if (edit->last_bracket != edit->bracket) edit->force |= REDRAW_PAGE; - last_bracket = edit->bracket; + edit->last_bracket = edit->bracket; } /* --------------------------------------------------------------------------------------------- */ diff --git a/src/editor/editwidget.h b/src/editor/editwidget.h index 11f834a1c..39017a268 100644 --- a/src/editor/editwidget.h +++ b/src/editor/editwidget.h @@ -128,6 +128,7 @@ struct WEdit long column1; /* position of column highlight start */ long column2; /* position of column highlight end */ off_t bracket; /* position of a matching bracket */ + off_t last_bracket; /* previous position of a matching bracket */ /* cache speedup for line lookups */ gboolean caches_valid; -- 2.11.4.GIT