summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-06-08 17:15:51 +0200
committerBram Moolenaar <Bram@vim.org>2019-06-08 17:15:51 +0200
commitacc682bd7ca66b74b42de7a5fb5d3ef37897926f (patch)
treed8d517bd1f426b0e8bc5c3f824000969fb18b8f9
parent1748c7f77ea864c669b7e5cfb2be0c34ce45e36e (diff)
patch 8.1.1496: popup window height is not recomputedv8.1.1496
Problem: Popup window height is not recomputed. Solution: Recompute the height when needed.
-rw-r--r--src/popupwin.c5
-rw-r--r--src/testdir/dumps/Test_popupwin_06.dump2
-rw-r--r--src/version.c2
3 files changed, 6 insertions, 3 deletions
diff --git a/src/popupwin.c b/src/popupwin.c
index 13ba6391db..000bed9b70 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -541,8 +541,7 @@ popup_adjust_position(win_T *wp)
wp->w_wincol = wp->w_wantcol - (wp->w_width + extra_width);
}
- if (wp->w_height <= 1)
- wp->w_height = wp->w_buffer->b_ml.ml_line_count + wrapped;
+ wp->w_height = wp->w_buffer->b_ml.ml_line_count + wrapped;
if (wp->w_minheight > 0 && wp->w_height < wp->w_minheight)
wp->w_height = wp->w_minheight;
if (wp->w_maxheight > 0 && wp->w_height > wp->w_maxheight)
@@ -566,11 +565,13 @@ popup_adjust_position(win_T *wp)
wp->w_popup_last_changedtick = CHANGEDTICK(wp->w_buffer);
// Need to update popup_mask if the position or size changed.
+ // And redraw windows that were behind the popup.
if (org_winrow != wp->w_winrow
|| org_wincol != wp->w_wincol
|| org_width != wp->w_width
|| org_height != wp->w_height)
{
+ // TODO: redraw only windows that were below the popup.
redraw_all_later(NOT_VALID);
popup_mask_refresh = TRUE;
}
diff --git a/src/testdir/dumps/Test_popupwin_06.dump b/src/testdir/dumps/Test_popupwin_06.dump
index 3dfcbc2f84..59a9d0ed00 100644
--- a/src/testdir/dumps/Test_popupwin_06.dump
+++ b/src/testdir/dumps/Test_popupwin_06.dump
@@ -4,7 +4,7 @@
|~| @6|o+0#0000001#ffd7ff255|t|h|e|r| |t|a|b| @15| +0#4040ff13#ffffff0@41
|~| @6|a+0#0000001#ffd7ff255| |c+0#ff404010&|o|m@1|e|n|t| +0#0000001&|l|i|n|e| @10| +0#4040ff13#ffffff0@41
|~| @6|t+0#0000001#ffd7ff255|h|i|s| |l|i|n|e| |w|i|l@1| |n|o|t| |f|i|t| |h|e| +0#4040ff13#ffffff0@41
-|~| @73
+|~| @6|r+0#0000001#ffd7ff255|e| @22| +0#4040ff13#ffffff0@41
|~| @73
|~| @73
|:+0#0000000&|r|e|d|r|a|w| @49|0|,|0|-|1| @8|A|l@1|
diff --git a/src/version.c b/src/version.c
index 504a1631c0..132329f053 100644
--- a/src/version.c
+++ b/src/version.c
@@ -768,6 +768,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1496,
+/**/
1495,
/**/
1494,