From 975b5271eed4fa0500c24a8f37be0b1797cb9db7 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 15 Mar 2016 23:10:59 +0100 Subject: patch 7.4.1578 Problem: There is no way to invoke a function later or periodically. Solution: Add timer support. --- src/screen.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/screen.c') diff --git a/src/screen.c b/src/screen.c index b293869cb..c1eb1c459 100644 --- a/src/screen.c +++ b/src/screen.c @@ -410,6 +410,27 @@ redraw_asap(int type) return ret; } +/* + * Invoked after an asynchronous callback is called. + * If an echo command was used the cursor needs to be put back where + * it belongs. If highlighting was changed a redraw is needed. + */ + void +redraw_after_callback() +{ + update_screen(0); + setcursor(); + cursor_on(); + out_flush(); +#ifdef FEAT_GUI + if (gui.in_use) + { + gui_update_cursor(TRUE, FALSE); + gui_mch_flush(); + } +#endif +} + /* * Changed something in the current window, at buffer line "lnum", that * requires that line and possibly other lines to be redrawn. -- cgit v1.2.1