From cbd2313dfdaac44f578fcd5549fd3f1c6dc055a1 Mon Sep 17 00:00:00 2001 From: Angel Ortega Date: Fri, 6 Feb 2009 14:30:33 +0100 Subject: [PATCH] New function mp.redraw(), to trigger a full document redraw. --- mp_core.c | 4 ++++ mp_core.mpsl | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/mp_core.c b/mp_core.c index c59c4f1..3273ad6 100644 --- a/mp_core.c +++ b/mp_core.c @@ -63,6 +63,7 @@ struct drw_1_info { int mod; /* modify count */ int preread_lines; /* lines to pre-read (for synhi blocks) */ int mark_eol; /* mark end of lines */ + int redraw; /* redraw trigger */ }; struct drw_1_info drw_1; @@ -252,6 +253,9 @@ static int drw_prepare(mpdm_t doc) /* last search regex */ drw_1.last_search = mpdm_hget_s(mp, L"last_search"); + /* redraw trigger */ + drw_1.redraw = mpdm_ival(mpdm_hget_s(mp, L"redraw_counter")); + /* compare drw_1 with drw_1_o; if they are the same, no more expensive calculations on drw_2 are needed */ if (memcmp(&drw_1, &drw_1_o, sizeof(drw_1)) == 0) diff --git a/mp_core.mpsl b/mp_core.mpsl index 20f8c2b..95e9da5 100644 --- a/mp_core.mpsl +++ b/mp_core.mpsl @@ -194,6 +194,18 @@ mp.actions_by_menu_label = {}; /** code **/ +/** + * mp.redraw - Triggers a redraw on the next cycle. + * + * Triggers a full document redraw in the next cycle. + */ +sub mp.redraw() +{ + /* just increment the redraw trigger */ + mp.redraw_trigger++; +} + + sub mp.active() /* returns the active document */ { -- 2.11.4.GIT