diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-06-20 00:00:18 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-01-05 17:29:11 -0500 |
commit | fd674c875bb129a2e7d5f59d85583a0ee8f3c97b (patch) | |
tree | 2f5d99243c0778d8551c387c289251b2a81a18b1 | |
parent | 38b4ca26b555e5bdca4d672917a85f1bd60297c2 (diff) | |
download | rneovim-fd674c875bb129a2e7d5f59d85583a0ee8f3c97b.tar.gz rneovim-fd674c875bb129a2e7d5f59d85583a0ee8f3c97b.tar.bz2 rneovim-fd674c875bb129a2e7d5f59d85583a0ee8f3c97b.zip |
vim-patch:8.0.0286: not always redrawing after screen resize
Problem: When concealing is active and the screen is resized in the GUI it
is not immediately redrawn.
Solution: Use update_prepare() and update_finish() from
update_single_line().
https://github.com/vim/vim/commit/c10f0e7cb0f35eea489b038e56c87b818eee975b
-rw-r--r-- | src/nvim/screen.c | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 5166bc2e42..f6e082f92e 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -477,6 +477,25 @@ void update_screen(int type) } +// Prepare for updating one or more windows. +// Caller must check for "updating_screen" already set to avoid recursiveness. +static void update_prepare(void) +{ + updating_screen = true; + start_search_hl(); +} + +// Finish updating one or more windows. +static void update_finish(void) +{ + if (redraw_cmdline) { + showmode(); + } + + end_search_hl(); + updating_screen = false; +} + /* * Return TRUE if the cursor line in window "wp" may be concealed, according * to the 'concealcursor' option. @@ -522,10 +541,11 @@ void update_single_line(win_T *wp, linenr_T lnum) if (linebuf_char == NULL || updating_screen) { return; } - updating_screen = true; if (lnum >= wp->w_topline && lnum < wp->w_botline && foldedCount(wp, lnum, &win_foldinfo) == 0) { + update_prepare(); + row = 0; for (j = 0; j < wp->w_lines_valid; ++j) { if (lnum == wp->w_lines[j].wl_lnum) { @@ -541,33 +561,10 @@ void update_single_line(win_T *wp, linenr_T lnum) } row += wp->w_lines[j].wl_size; } + + update_finish(); } need_cursor_line_redraw = false; - updating_screen = false; -} - - -/* - * Prepare for updating one or more windows. - * Caller must check for "updating_screen" already set to avoid recursiveness. - */ -static void update_prepare(void) -{ - updating_screen = TRUE; - start_search_hl(); -} - -/* - * Finish updating one or more windows. - */ -static void update_finish(void) -{ - if (redraw_cmdline) { - showmode(); - } - - end_search_hl(); - updating_screen = FALSE; } void update_debug_sign(const buf_T *const buf, const linenr_T lnum) |