mirror of
https://github.com/vim/vim.git
synced 2025-07-25 10:54:51 -04:00
patch 8.0.0286: not always redrawing after screen resize
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().
This commit is contained in:
parent
c386267ffe
commit
c10f0e7cb0
122
src/screen.c
122
src/screen.c
@ -777,6 +777,57 @@ update_screen(int type)
|
|||||||
#endif
|
#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)
|
#if defined(FEAT_CONCEAL) || defined(PROTO)
|
||||||
/*
|
/*
|
||||||
* Return TRUE if the cursor line in window "wp" may be concealed, according
|
* Return TRUE if the cursor line in window "wp" may be concealed, according
|
||||||
@ -826,17 +877,12 @@ update_single_line(win_T *wp, linenr_T lnum)
|
|||||||
/* Don't do anything if the screen structures are (not yet) valid. */
|
/* Don't do anything if the screen structures are (not yet) valid. */
|
||||||
if (!screen_valid(TRUE) || updating_screen)
|
if (!screen_valid(TRUE) || updating_screen)
|
||||||
return;
|
return;
|
||||||
updating_screen = TRUE;
|
|
||||||
|
|
||||||
if (lnum >= wp->w_topline && lnum < wp->w_botline
|
if (lnum >= wp->w_topline && lnum < wp->w_botline
|
||||||
&& foldedCount(wp, lnum, &win_foldinfo) == 0)
|
&& foldedCount(wp, lnum, &win_foldinfo) == 0)
|
||||||
{
|
{
|
||||||
# ifdef FEAT_GUI
|
update_prepare();
|
||||||
/* 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;
|
row = 0;
|
||||||
for (j = 0; j < wp->w_lines_valid; ++j)
|
for (j = 0; j < wp->w_lines_valid; ++j)
|
||||||
{
|
{
|
||||||
@ -856,68 +902,10 @@ update_single_line(win_T *wp, linenr_T lnum)
|
|||||||
}
|
}
|
||||||
row += wp->w_lines[j].wl_size;
|
row += wp->w_lines[j].wl_size;
|
||||||
}
|
}
|
||||||
# ifdef FEAT_GUI
|
|
||||||
/* Redraw the cursor */
|
update_finish();
|
||||||
if (gui.in_use)
|
|
||||||
{
|
|
||||||
out_flush(); /* required before updating the cursor */
|
|
||||||
gui_update_cursor(FALSE, FALSE);
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
need_cursor_line_redraw = FALSE;
|
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
|
#endif
|
||||||
|
|
||||||
|
@ -764,6 +764,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
286,
|
||||||
/**/
|
/**/
|
||||||
285,
|
285,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user