comparison src/drawscreen.c @ 24527:a878e5e892cf v8.2.2803

patch 8.2.2803: flicker when the popup menu has an info popup Commit: https://github.com/vim/vim/commit/e0c03c8e107f109eadab145e18544d8e74a6976e Author: Bram Moolenaar <Bram@vim.org> Date: Fri Apr 23 21:01:34 2021 +0200 patch 8.2.2803: flicker when the popup menu has an info popup Problem: Flicker when the popup menu has an info popup. Solution: Avoid drawing over the popup when it's going to be redrawn in the same position. (closes #8131) Also avoid redrawing the scrollbar.
author Bram Moolenaar <Bram@vim.org>
date Fri, 23 Apr 2021 21:15:04 +0200
parents 3efc5cb6a404
children b7062becbfb5
comparison
equal deleted inserted replaced
24526:df39b96338bb 24527:a878e5e892cf
91 int did_undraw = FALSE; 91 int did_undraw = FALSE;
92 int gui_cursor_col = 0; 92 int gui_cursor_col = 0;
93 int gui_cursor_row = 0; 93 int gui_cursor_row = 0;
94 #endif 94 #endif
95 int no_update = FALSE; 95 int no_update = FALSE;
96 int save_pum_will_redraw = pum_will_redraw;
96 97
97 // Don't do anything if the screen structures are (not yet) valid. 98 // Don't do anything if the screen structures are (not yet) valid.
98 if (!screen_valid(TRUE)) 99 if (!screen_valid(TRUE))
99 return FAIL; 100 return FAIL;
100 101
274 syn_stack_apply_changes(wp->w_buffer); 275 syn_stack_apply_changes(wp->w_buffer);
275 } 276 }
276 } 277 }
277 #endif 278 #endif
278 279
280 if (pum_redraw_in_same_position())
281 // Avoid flicker if the popup menu is going to be redrawn in the same
282 // position.
283 pum_will_redraw = TRUE;
284
279 // Go from top to bottom through the windows, redrawing the ones that need 285 // Go from top to bottom through the windows, redrawing the ones that need
280 // it. 286 // it.
281 #if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD) 287 #if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD)
282 did_update_one_window = FALSE; 288 did_update_one_window = FALSE;
283 #endif 289 #endif
319 } 325 }
320 } 326 }
321 #if defined(FEAT_SEARCH_EXTRA) 327 #if defined(FEAT_SEARCH_EXTRA)
322 end_search_hl(); 328 end_search_hl();
323 #endif 329 #endif
330
324 // May need to redraw the popup menu. 331 // May need to redraw the popup menu.
332 pum_will_redraw = save_pum_will_redraw;
325 pum_may_redraw(); 333 pum_may_redraw();
326 334
327 // Reset b_mod_set flags. Going through all windows is probably faster 335 // Reset b_mod_set flags. Going through all windows is probably faster
328 // than going through all buffers (there could be many buffers). 336 // than going through all buffers (there could be many buffers).
329 FOR_ALL_WINDOWS(wp) 337 FOR_ALL_WINDOWS(wp)