summaryrefslogtreecommitdiffstats
path: root/src/drawscreen.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-02-28 22:20:10 +0100
committerBram Moolenaar <Bram@vim.org>2020-02-28 22:20:10 +0100
commite52e0c89d1a6305beca3c01f89a4892dcb43bc71 (patch)
treed54216cc94ae0eb3c8a737b3298be99b9360297c /src/drawscreen.c
parent80ae880f5fed8022c69d05dd1efee49259929cb5 (diff)
patch 8.2.0328: no redraw when leaving term-normal mode in popup terminalv8.2.0328
Problem: No redraw when leaving terminal-normal mode in a terminal popup window. Solution: Redraw the popup window. (closes #5708)
Diffstat (limited to 'src/drawscreen.c')
-rw-r--r--src/drawscreen.c49
1 files changed, 32 insertions, 17 deletions
diff --git a/src/drawscreen.c b/src/drawscreen.c
index 6b755c8c9b..17a385c924 100644
--- a/src/drawscreen.c
+++ b/src/drawscreen.c
@@ -69,6 +69,9 @@ static void win_update(win_T *wp);
#ifdef FEAT_STL_OPT
static void redraw_custom_statusline(win_T *wp);
#endif
+#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD)
+static int did_update_one_window;
+#endif
/*
* Based on the current value of curwin->w_topline, transfer a screenfull
@@ -81,10 +84,8 @@ update_screen(int type_arg)
int type = type_arg;
win_T *wp;
static int did_intro = FALSE;
-#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD)
- int did_one;
-#endif
#ifdef FEAT_GUI
+ int did_one = FALSE;
int did_undraw = FALSE;
int gui_cursor_col = 0;
int gui_cursor_row = 0;
@@ -276,7 +277,7 @@ update_screen(int type_arg)
// Go from top to bottom through the windows, redrawing the ones that need
// it.
#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD)
- did_one = FALSE;
+ did_update_one_window = FALSE;
#endif
#ifdef FEAT_SEARCH_EXTRA
screen_search_hl.rm.regprog = NULL;
@@ -286,21 +287,11 @@ update_screen(int type_arg)
if (wp->w_redr_type != 0)
{
cursor_off();
-#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD)
+#ifdef FEAT_GUI
if (!did_one)
{
did_one = TRUE;
-# ifdef FEAT_SEARCH_EXTRA
- start_search_hl();
-# endif
-# ifdef FEAT_CLIPBOARD
- // When Visual area changed, may have to update selection.
- if (clip_star.available && clip_isautosel_star())
- clip_update_selection(&clip_star);
- if (clip_plus.available && clip_isautosel_plus())
- clip_update_selection(&clip_plus);
-# endif
-#ifdef FEAT_GUI
+
// Remove the cursor before starting to do anything, because
// scrolling may make it difficult to redraw the text under
// it.
@@ -311,9 +302,9 @@ update_screen(int type_arg)
gui_undraw_cursor();
did_undraw = TRUE;
}
-#endif
}
#endif
+
win_update(wp);
}
@@ -1422,6 +1413,25 @@ win_update(win_T *wp)
proftime_T syntax_tm;
#endif
+#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD)
+ // This needs to be done only for the first window when update_screen() is
+ // called.
+ if (!did_update_one_window)
+ {
+ did_update_one_window = TRUE;
+# ifdef FEAT_SEARCH_EXTRA
+ start_search_hl();
+# endif
+# ifdef FEAT_CLIPBOARD
+ // When Visual area changed, may have to update selection.
+ if (clip_star.available && clip_isautosel_star())
+ clip_update_selection(&clip_star);
+ if (clip_plus.available && clip_isautosel_plus())
+ clip_update_selection(&clip_plus);
+# endif
+ }
+#endif
+
type = wp->w_redr_type;
if (type == NOT_VALID)
@@ -3025,6 +3035,11 @@ redraw_buf_later(buf_T *buf, int type)
if (wp->w_buffer == buf)
redraw_win_later(wp, type);
}
+#if defined(FEAT_TERMINAL) && defined(FEAT_PROP_POPUP)
+ // terminal in popup window is not in list of windows
+ if (curwin->w_buffer == buf)
+ redraw_win_later(curwin, type);
+#endif
}
#if defined(FEAT_SIGNS) || defined(PROTO)