To: vim_dev@googlegroups.com Subject: Patch 8.0.0286 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0286 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(). Files: src/screen.c *** ../vim-8.0.0285/src/screen.c 2017-01-31 21:53:35.045154104 +0100 --- src/screen.c 2017-02-01 18:33:41.922442269 +0100 *************** *** 777,782 **** --- 777,833 ---- #endif } + #if defined(FEAT_SIGNS) || defined(FEAT_GUI) || defined(FEAT_CONCEAL) + /* + * Prepare for updating one or more windows. + * Caller must check for "updating_screen" already set to avoid recursiveness. + */ + static void + update_prepare(void) + { + cursor_off(); + updating_screen = TRUE; + #ifdef FEAT_GUI + /* Remove the cursor before starting to do anything, because scrolling may + * make it difficult to redraw the text under it. */ + if (gui.in_use) + gui_undraw_cursor(); + #endif + #ifdef FEAT_SEARCH_EXTRA + start_search_hl(); + #endif + } + + /* + * Finish updating one or more windows. + */ + static void + update_finish(void) + { + if (redraw_cmdline) + showmode(); + + # ifdef FEAT_SEARCH_EXTRA + end_search_hl(); + # endif + + updating_screen = FALSE; + + # ifdef FEAT_GUI + gui_may_resize_shell(); + + /* Redraw the cursor and update the scrollbars when all screen updating is + * done. */ + if (gui.in_use) + { + out_flush(); /* required before updating the cursor */ + gui_update_cursor(FALSE, FALSE); + gui_update_scrollbars(FALSE); + } + # endif + } + #endif + #if defined(FEAT_CONCEAL) || defined(PROTO) /* * Return TRUE if the cursor line in window "wp" may be concealed, according *************** *** 826,842 **** /* Don't do anything if the screen structures are (not yet) valid. */ if (!screen_valid(TRUE) || updating_screen) return; - updating_screen = TRUE; if (lnum >= wp->w_topline && lnum < wp->w_botline && foldedCount(wp, lnum, &win_foldinfo) == 0) { ! # ifdef FEAT_GUI ! /* Remove the cursor before starting to do anything, because scrolling ! * may make it difficult to redraw the text under it. */ ! if (gui.in_use) ! gui_undraw_cursor(); ! # endif row = 0; for (j = 0; j < wp->w_lines_valid; ++j) { --- 877,888 ---- /* Don't do anything if the screen structures are (not yet) valid. */ if (!screen_valid(TRUE) || updating_screen) return; 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) { *************** *** 856,923 **** } row += wp->w_lines[j].wl_size; } - # ifdef FEAT_GUI - /* Redraw the cursor */ - if (gui.in_use) - { - out_flush(); /* required before updating the cursor */ - gui_update_cursor(FALSE, FALSE); - } - # endif - } - need_cursor_line_redraw = FALSE; - updating_screen = FALSE; - } - #endif - - #if defined(FEAT_SIGNS) || defined(FEAT_GUI) - /* - * Prepare for updating one or more windows. - * Caller must check for "updating_screen" already set to avoid recursiveness. - */ - static void - update_prepare(void) - { - cursor_off(); - updating_screen = TRUE; - #ifdef FEAT_GUI - /* Remove the cursor before starting to do anything, because scrolling may - * make it difficult to redraw the text under it. */ - if (gui.in_use) - gui_undraw_cursor(); - #endif - #ifdef FEAT_SEARCH_EXTRA - start_search_hl(); - #endif - } ! /* ! * Finish updating one or more windows. ! */ ! static void ! update_finish(void) ! { ! if (redraw_cmdline) ! showmode(); ! ! # ifdef FEAT_SEARCH_EXTRA ! end_search_hl(); ! # endif ! ! updating_screen = FALSE; ! ! # ifdef FEAT_GUI ! gui_may_resize_shell(); ! ! /* Redraw the cursor and update the scrollbars when all screen updating is ! * done. */ ! if (gui.in_use) ! { ! out_flush(); /* required before updating the cursor */ ! gui_update_cursor(FALSE, FALSE); ! gui_update_scrollbars(FALSE); } ! # endif } #endif --- 902,911 ---- } row += wp->w_lines[j].wl_size; } ! update_finish(); } ! need_cursor_line_redraw = FALSE; } #endif *** ../vim-8.0.0285/src/version.c 2017-02-01 18:07:33.060643434 +0100 --- src/version.c 2017-02-01 18:35:14.009844134 +0100 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 286, /**/ -- BEDEVERE: Oooooh! LAUNCELOT: No "Aaaaarrrrrrggghhh ... " at the back of the throat. BEDEVERE: No! "Oooooh!" in surprise and alarm! "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///