diff options
author | zeertzjq <zeertzjq@outlook.com> | 2025-03-28 15:37:49 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2025-03-29 21:12:32 +0800 |
commit | 62da4e2949cc906102bd768cdd40b274623822b6 (patch) | |
tree | f81120d9e4b80abd16b3ceb6c46149b550b5be18 /test/old | |
parent | 89bc9455543abbd98bba752367ab5f2b83943931 (diff) | |
download | rneovim-62da4e2949cc906102bd768cdd40b274623822b6.tar.gz rneovim-62da4e2949cc906102bd768cdd40b274623822b6.tar.bz2 rneovim-62da4e2949cc906102bd768cdd40b274623822b6.zip |
vim-patch:9.1.1250: cannot set the maximum popup menu width
Problem: cannot set the maximum popup menu width
(Lucas Mior)
Solution: add the new global option value 'pummaxwidth'
(glepnir)
fixes: vim/vim#10901
closes: vim/vim#16943
https://github.com/vim/vim/commit/88d75934c3d5bc4c406343f106e1a61638abd3a7
Co-authored-by: glepnir <glephunter@gmail.com>
Diffstat (limited to 'test/old')
-rw-r--r-- | test/old/testdir/test_popup.vim | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/test/old/testdir/test_popup.vim b/test/old/testdir/test_popup.vim index 8f81db6213..631a81d5cc 100644 --- a/test/old/testdir/test_popup.vim +++ b/test/old/testdir/test_popup.vim @@ -1992,4 +1992,81 @@ func Test_pum_complete_with_special_characters() call StopVimInTerminal(buf) endfunc +func Test_pum_maxwidth() + CheckScreendump + + let lines =<< trim END + 123456789_123456789_123456789_a + 123456789_123456789_123456789_b + 123 + END + call writefile(lines, 'Xtest', 'D') + let buf = RunVimInTerminal('Xtest', {}) + + call term_sendkeys(buf, "G\"zyy") + call term_sendkeys(buf, "A\<C-N>") + call VerifyScreenDump(buf, 'Test_pum_maxwidth_01', {'rows': 8}) + call term_sendkeys(buf, "\<Esc>3Gdd\"zp") + + call term_sendkeys(buf, ":set pummaxwidth=10\<CR>") + call term_sendkeys(buf, "GA\<C-N>") + call VerifyScreenDump(buf, 'Test_pum_maxwidth_02', {'rows': 8}) + call term_sendkeys(buf, "\<Esc>3Gdd\"zp") + + call term_sendkeys(buf, ":set pummaxwidth=20\<CR>") + call term_sendkeys(buf, "GA\<C-N>") + call VerifyScreenDump(buf, 'Test_pum_maxwidth_03', {'rows': 8}) + call term_sendkeys(buf, "\<Esc>3Gdd\"zp") + + call term_sendkeys(buf, ":set pumwidth=20 pummaxwidth=8\<CR>") + call term_sendkeys(buf, "GA\<C-N>") + call VerifyScreenDump(buf, 'Test_pum_maxwidth_04', {'rows': 8}) + call term_sendkeys(buf, "\<Esc>3Gdd\"zp") + + call StopVimInTerminal(buf) +endfunc + +func Test_pum_maxwidth_multibyte() + CheckScreendump + + let lines =<< trim END + func Omni_test(findstart, base) + if a:findstart + return col(".") + endif + return [ + \ #{word: "123456789_123456789_123456789_"}, + \ #{word: "一二三四五六七八九十"}, + \ ] + endfunc + set omnifunc=Omni_test + END + call writefile(lines, 'Xtest', 'D') + let buf = RunVimInTerminal('-S Xtest', {}) + call TermWait(buf) + + call term_sendkeys(buf, "S\<C-X>\<C-O>") + call VerifyScreenDump(buf, 'Test_pum_maxwidth_05', {'rows': 8}) + call term_sendkeys(buf, "\<ESC>") + + call term_sendkeys(buf, ":set pummaxwidth=10\<CR>") + call term_sendkeys(buf, "S\<C-X>\<C-O>") + call VerifyScreenDump(buf, 'Test_pum_maxwidth_06', {'rows': 8}) + call term_sendkeys(buf, "\<ESC>") + + if has('rightleft') + call term_sendkeys(buf, ":set rightleft\<CR>") + call term_sendkeys(buf, "S\<C-X>\<C-O>") + call VerifyScreenDump(buf, 'Test_pum_maxwidth_07', {'rows': 8}) + call term_sendkeys(buf, "\<Esc>:set norightleft\<CR>") + endif + + call term_sendkeys(buf, ":set pummaxwidth=2\<CR>") + call term_sendkeys(buf, "S\<C-X>\<C-O>") + call VerifyScreenDump(buf, 'Test_pum_maxwidth_08', {'rows': 8}) + call term_sendkeys(buf, "\<ESC>") + + call StopVimInTerminal(buf) +endfunc + " vim: shiftwidth=2 sts=2 expandtab |