diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-01-17 21:09:05 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-01-17 21:09:05 +0100 |
commit | ae654385dfb2ae4c1d70789d1dce3676dba4dfbc (patch) | |
tree | 42dcbad57fb99544e9346fa8b075df03865ba1f4 /src/edit.c | |
parent | c771bf901622064dc27421b04853e16b6914a295 (diff) |
patch 8.1.0768: updating completions may cause the popup menu to flickerv8.1.0768
Problem: Updating completions may cause the popup menu to flicker.
Solution: Avoid updating the text below the popup menu before drawing the
popup menu.
Diffstat (limited to 'src/edit.c')
-rw-r--r-- | src/edit.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/edit.c b/src/edit.c index effc524d30..ea50e80184 100644 --- a/src/edit.c +++ b/src/edit.c @@ -3020,7 +3020,8 @@ ins_compl_upd_pum(void) if (compl_match_array != NULL) { h = curwin->w_cline_height; - update_screen(0); + // Update the screen later, before drawing the popup menu over it. + pum_call_update_screen(); if (h != curwin->w_cline_height) ins_compl_del_pum(); } @@ -3110,8 +3111,8 @@ ins_compl_show_pum(void) do_cmdline_cmd((char_u *)"if exists('g:loaded_matchparen')|3match none|endif"); #endif - /* Update the screen before drawing the popup menu over it. */ - update_screen(0); + // Update the screen later, before drawing the popup menu over it. + pum_call_update_screen(); if (compl_match_array == NULL) { @@ -3668,11 +3669,11 @@ ins_compl_new_leader(void) spell_bad_len = 0; /* need to redetect bad word */ #endif /* - * Matches were cleared, need to search for them now. First display - * the changed text before the cursor. Set "compl_restarting" to - * avoid that the first match is inserted. + * Matches were cleared, need to search for them now. Befor drawing + * the popup menu display the changed text before the cursor. Set + * "compl_restarting" to avoid that the first match is inserted. */ - update_screen(0); + pum_call_update_screen(); #ifdef FEAT_GUI if (gui.in_use) { @@ -5077,8 +5078,9 @@ ins_compl_next( /* may undisplay the popup menu first */ ins_compl_upd_pum(); - /* redraw to show the user what was inserted */ - update_screen(0); + // Redraw before showing the popup menu to show the user what was + // inserted. + pum_call_update_screen(); /* display the updated popup menu */ ins_compl_show_pum(); |