patch 9.1.1255: missing test condition for 'pummaxwidth' setting
Problem: missing test condition for 'pummaxwidth' setting, pummaxwidth
not effective when width is 32 and height is 10
(after v9.1.1250)
Solution: add missing comparison condition in pum_width()
(glepnir)
closes: #16999
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/popupmenu.c b/src/popupmenu.c
index d69c7bd..5a2f070 100644
--- a/src/popupmenu.c
+++ b/src/popupmenu.c
@@ -342,6 +342,10 @@
if (p_pmw > 0 && pum_width > p_pmw)
pum_width = p_pmw;
}
+ else if (p_pmw > 0 && pum_width > p_pmw)
+ {
+ pum_width = p_pmw;
+ }
}
}
diff --git a/src/testdir/dumps/Test_pum_maxwidth_09.dump b/src/testdir/dumps/Test_pum_maxwidth_09.dump
new file mode 100644
index 0000000..f46d0aa
--- /dev/null
+++ b/src/testdir/dumps/Test_pum_maxwidth_09.dump
@@ -0,0 +1,10 @@
+|1+0&#ffffff0|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|a|
+|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|b|
+@12|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_
+|1|2|3|4|5|6|7|8|9|_|a> @20
+|~+0#4040ff13&| @9| +0#0000001#e0e0e08|1|2|3|4|5|.@2| +0#4040ff13#ffffff0@11
+|~| @9| +0#0000001#ffd7ff255|1|2|3|4|5|.@2| +0#4040ff13#ffffff0@11
+|~| @30
+|~| @30
+|~| @30
+|-+2#0000000&@1| |m+0#00e0003&|a|t|c|h| |1| |o|f| |2| +0#0000000&@16
diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim
index 94839b5..e95465c 100644
--- a/src/testdir/test_popup.vim
+++ b/src/testdir/test_popup.vim
@@ -2017,6 +2017,11 @@
call VerifyScreenDump(buf, 'Test_pum_maxwidth_04', {'rows': 8})
call term_sendkeys(buf, "\<Esc>3Gdd\"zp")
+ call term_sendkeys(buf, ":set lines=10 columns=32\<CR>")
+ call term_sendkeys(buf, "GA\<C-N>")
+ call VerifyScreenDump(buf, 'Test_pum_maxwidth_09', {'rows': 10, 'cols': 32})
+ call term_sendkeys(buf, "\<Esc>3Gdd\"zp")
+
call StopVimInTerminal(buf)
endfunc
diff --git a/src/version.c b/src/version.c
index e302255..d8e55f9 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1255,
+/**/
1254,
/**/
1253,