Mercurial > vim
comparison src/edit.c @ 15521:6d949e552e99 v8.1.0768
patch 8.1.0768: updating completions may cause the popup menu to flicker
commit https://github.com/vim/vim/commit/ae654385dfb2ae4c1d70789d1dce3676dba4dfbc
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jan 17 21:09:05 2019 +0100
patch 8.1.0768: updating completions may cause the popup menu to flicker
Problem: Updating completions may cause the popup menu to flicker.
Solution: Avoid updating the text below the popup menu before drawing the
popup menu.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 17 Jan 2019 21:15:06 +0100 |
parents | 55ccc2d353bd |
children | dd725a8ab112 |
comparison
equal
deleted
inserted
replaced
15520:f356d2eb8202 | 15521:6d949e552e99 |
---|---|
3018 int h; | 3018 int h; |
3019 | 3019 |
3020 if (compl_match_array != NULL) | 3020 if (compl_match_array != NULL) |
3021 { | 3021 { |
3022 h = curwin->w_cline_height; | 3022 h = curwin->w_cline_height; |
3023 update_screen(0); | 3023 // Update the screen later, before drawing the popup menu over it. |
3024 pum_call_update_screen(); | |
3024 if (h != curwin->w_cline_height) | 3025 if (h != curwin->w_cline_height) |
3025 ins_compl_del_pum(); | 3026 ins_compl_del_pum(); |
3026 } | 3027 } |
3027 } | 3028 } |
3028 | 3029 |
3108 #if defined(FEAT_EVAL) | 3109 #if defined(FEAT_EVAL) |
3109 /* Dirty hard-coded hack: remove any matchparen highlighting. */ | 3110 /* Dirty hard-coded hack: remove any matchparen highlighting. */ |
3110 do_cmdline_cmd((char_u *)"if exists('g:loaded_matchparen')|3match none|endif"); | 3111 do_cmdline_cmd((char_u *)"if exists('g:loaded_matchparen')|3match none|endif"); |
3111 #endif | 3112 #endif |
3112 | 3113 |
3113 /* Update the screen before drawing the popup menu over it. */ | 3114 // Update the screen later, before drawing the popup menu over it. |
3114 update_screen(0); | 3115 pum_call_update_screen(); |
3115 | 3116 |
3116 if (compl_match_array == NULL) | 3117 if (compl_match_array == NULL) |
3117 { | 3118 { |
3118 /* Need to build the popup menu list. */ | 3119 /* Need to build the popup menu list. */ |
3119 compl_match_arraysize = 0; | 3120 compl_match_arraysize = 0; |
3666 { | 3667 { |
3667 #ifdef FEAT_SPELL | 3668 #ifdef FEAT_SPELL |
3668 spell_bad_len = 0; /* need to redetect bad word */ | 3669 spell_bad_len = 0; /* need to redetect bad word */ |
3669 #endif | 3670 #endif |
3670 /* | 3671 /* |
3671 * Matches were cleared, need to search for them now. First display | 3672 * Matches were cleared, need to search for them now. Befor drawing |
3672 * the changed text before the cursor. Set "compl_restarting" to | 3673 * the popup menu display the changed text before the cursor. Set |
3673 * avoid that the first match is inserted. | 3674 * "compl_restarting" to avoid that the first match is inserted. |
3674 */ | 3675 */ |
3675 update_screen(0); | 3676 pum_call_update_screen(); |
3676 #ifdef FEAT_GUI | 3677 #ifdef FEAT_GUI |
3677 if (gui.in_use) | 3678 if (gui.in_use) |
3678 { | 3679 { |
3679 /* Show the cursor after the match, not after the redrawn text. */ | 3680 /* Show the cursor after the match, not after the redrawn text. */ |
3680 setcursor(); | 3681 setcursor(); |
5075 if (!allow_get_expansion) | 5076 if (!allow_get_expansion) |
5076 { | 5077 { |
5077 /* may undisplay the popup menu first */ | 5078 /* may undisplay the popup menu first */ |
5078 ins_compl_upd_pum(); | 5079 ins_compl_upd_pum(); |
5079 | 5080 |
5080 /* redraw to show the user what was inserted */ | 5081 // Redraw before showing the popup menu to show the user what was |
5081 update_screen(0); | 5082 // inserted. |
5083 pum_call_update_screen(); | |
5082 | 5084 |
5083 /* display the updated popup menu */ | 5085 /* display the updated popup menu */ |
5084 ins_compl_show_pum(); | 5086 ins_compl_show_pum(); |
5085 #ifdef FEAT_GUI | 5087 #ifdef FEAT_GUI |
5086 if (gui.in_use) | 5088 if (gui.in_use) |