0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.2.0011: screen updating wrong when opeing preview window

Problem:    Screen updating wrong when opeing preview window.
Solution:   Redraw the window when the preview window opens.
This commit is contained in:
Bram Moolenaar
2019-12-15 14:55:33 +01:00
parent f9cb05c147
commit 5e5a98d7de
4 changed files with 46 additions and 4 deletions

View File

@@ -913,7 +913,7 @@ pum_set_selected(int n, int repeat UNUSED)
// When the preview window was resized we need to
// update the view on the buffer. Only go back to
// the window when needed, otherwise it will always be
// redraw.
// redrawn.
if (resized && win_valid(curwin_save))
{
++no_u_sync;
@@ -926,8 +926,9 @@ pum_set_selected(int n, int repeat UNUSED)
// Enable updating the status lines.
pum_pretend_not_visible = TRUE;
// But don't draw text at the new popup menu position,
// it causes flicker.
pum_will_redraw = TRUE;
// it causes flicker. When resizing we need to draw
// anyway, the position may change later.
pum_will_redraw = !resized;
update_screen(0);
pum_pretend_not_visible = FALSE;
pum_will_redraw = FALSE;
@@ -949,7 +950,7 @@ pum_set_selected(int n, int repeat UNUSED)
// May need to update the screen again when there are
// autocommands involved.
pum_pretend_not_visible = TRUE;
pum_will_redraw = TRUE;
pum_will_redraw = !resized;
update_screen(0);
pum_pretend_not_visible = FALSE;
pum_will_redraw = FALSE;