]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1255: missing test condition for 'pummaxwidth' setting v9.1.1255
authorglepnir <glephunter@gmail.com>
Fri, 28 Mar 2025 18:21:59 +0000 (19:21 +0100)
committerChristian Brabandt <cb@256bit.org>
Fri, 28 Mar 2025 18:21:59 +0000 (19:21 +0100)
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>
runtime/optwin.vim
src/popupmenu.c
src/testdir/dumps/Test_pum_maxwidth_09.dump [new file with mode: 0644]
src/testdir/test_popup.vim
src/version.c

index 9b592117126c568dc13f150cff392ac561ccd6d0..2bcea9df0140c0de728d516eb5b1feeba529202e 100644 (file)
@@ -1,7 +1,7 @@
 " These commands create the option window.
 "
 " Maintainer:  The Vim Project <https://github.com/vim/vim>
-" Last Change: 2025 Mar 27
+" Last Change: 2025 Mar 28
 " Former Maintainer:   Bram Moolenaar <Bram@vim.org>
 
 " If there already is an option window, jump to that one.
@@ -863,7 +863,7 @@ if has("insert_expand")
   call <SID>OptionG("ph", &ph)
   call <SID>AddOption("pumwidth", gettext("minimum width of the popup menu"))
   call <SID>OptionG("pw", &pw)
-  call <SID>AddOption("pumaxmwidth", gettext("maximum width of the popup menu"))
+  call <SID>AddOption("pummaxwidth", gettext("maximum width of the popup menu"))
   call <SID>OptionG("pmw", &pmw)
   call <SID>AddOption("completefunc", gettext("user defined function for Insert mode completion"))
   call append("$", "\t" .. s:local_to_buffer)
index d69c7bd849082c86eeff962e9a20b34ae7f2cedc..5a2f070313ff17c0b540b2b5fd2fad34de604f57 100644 (file)
@@ -342,6 +342,10 @@ pum_display(
                    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 (file)
index 0000000..f46d0aa
--- /dev/null
@@ -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
index 94839b5b77abaaf2c6d6375c84e5df336a1f3cec..e95465c2d4dad950328b981a0f85e1d98eeef7b3 100644 (file)
@@ -2017,6 +2017,11 @@ func Test_pum_maxwidth()
   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
 
index e30225531b5f343dc3fb0bf4a6009fda7772464e..d8e55f9c46a05eab84c8c4d8cf1c2ec05aa5fe59 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1255,
 /**/
     1254,
 /**/