summaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-06-11 21:56:30 +0200
committerBram Moolenaar <Bram@vim.org>2019-06-11 21:56:30 +0200
commit202d982b36d87cf91d992bd7e30d3223bdc72cd9 (patch)
tree641017ae67f732dc9065e35fe051ff710a545429 /src/screen.c
parent12ee7ff00b91d852e060bb24951d1c94239863eb (diff)
downloadvim-git-202d982b36d87cf91d992bd7e30d3223bdc72cd9.tar.gz
patch 8.1.1518: crash when setting 'columns' while a popup is visiblev8.1.1518
Problem: Crash when setting 'columns' while a popup is visible. Solution: Recompute all positions when clearing the screen. (closes #4467)
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/screen.c b/src/screen.c
index 1ffc729df..644829ead 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -1029,9 +1029,16 @@ may_update_popup_mask(int type)
win_T *wp;
short *mask;
int line, col;
+ int redraw_all = FALSE;
- if (popup_mask_tab != curtab)
+ // Need to recompute when switching tabs.
+ // Also recompute when the type is CLEAR or NOT_VALID, something basic
+ // (such as the screen size) must have changed.
+ if (popup_mask_tab != curtab || type >= NOT_VALID)
+ {
popup_mask_refresh = TRUE;
+ redraw_all = TRUE;
+ }
if (!popup_mask_refresh)
{
// Check if any buffer has changed.
@@ -1070,7 +1077,8 @@ may_update_popup_mask(int type)
popup_visible = TRUE;
// Recompute the position if the text changed.
- if (wp->w_popup_last_changedtick != CHANGEDTICK(wp->w_buffer))
+ if (redraw_all
+ || wp->w_popup_last_changedtick != CHANGEDTICK(wp->w_buffer))
popup_adjust_position(wp);
// the width and height are for the inside, add the padding and