neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit afca5b564e766a2ba1049c52e6e4e04d82a09388
parent 54d60550982812f32df76bb69dc4e44ac81a645e
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Wed, 16 Apr 2025 07:49:16 +0800

vim-patch:9.1.1309: tests: no test for 'pummaxwidth' with non-truncated "kind"

Problem:  tests: no test for 'pummaxwidth' with non-truncated "kind".
Solution: Add a test with "kind" and larger 'pummaxwidth' (zeertzjq).

closes: vim/vim#17126

https://github.com/vim/vim/commit/031919c7ac66c4fcff3719b4f4158887b68d3315

Diffstat:
Mtest/functional/ui/popupmenu_spec.lua | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtest/old/testdir/test_popup.vim | 14++++++++++++++
2 files changed, 79 insertions(+), 0 deletions(-)

diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua @@ -6334,6 +6334,71 @@ describe('builtin popupmenu', function() end feed('<Esc>') command('set norightleft') + + command('set pummaxwidth=16') + feed('S<C-X><C-O>') + if multigrid then + screen:expect({ + grid = [[ + ## grid 1 + [2:--------------------------------]|*19 + [3:--------------------------------]| + ## grid 2 + foo^ | + {1:~ }|*18 + ## grid 3 + {2:-- }{5:match 1 of 3} | + ## grid 4 + {s:foo fooK>}| + {n:bar 一二>}| + {n:一二三四五 multi}| + ]], + float_pos = { [4] = { -1, 'NW', 2, 1, 0, false, 100, 1, 1, 0 } }, + }) + else + screen:expect([[ + foo^ | + {s:foo fooK>}{1: }| + {n:bar 一二>}{1: }| + {n:一二三四五 multi}{1: }| + {1:~ }|*15 + {2:-- }{5:match 1 of 3} | + ]]) + end + feed('<Esc>') + + command('set rightleft') + feed('S<C-X><C-O>') + if multigrid then + screen:expect({ + grid = [[ + ## grid 1 + [2:--------------------------------]|*19 + [3:--------------------------------]| + ## grid 2 + ^ oof| + {1: ~}|*18 + ## grid 3 + {2:-- }{5:match 1 of 3} | + ## grid 4 + {s:<Koof oof}| + {n:<二一 rab}| + {n:itlum 五四三二一}| + ]], + float_pos = { [4] = { -1, 'NW', 2, 1, 16, false, 100, 1, 1, 16 } }, + }) + else + screen:expect([[ + ^ oof| + {1: }{s:<Koof oof}| + {1: }{n:<二一 rab}| + {1: }{n:itlum 五四三二一}| + {1: ~}|*15 + {2:-- }{5:match 1 of 3} | + ]]) + end + feed('<Esc>') + command('set norightleft') end) it('does not crash when displayed in last column with rightleft #12032', function() diff --git a/test/old/testdir/test_popup.vim b/test/old/testdir/test_popup.vim @@ -2160,6 +2160,20 @@ func Test_pum_maxwidth_multibyte() call term_sendkeys(buf, "\<Esc>:set norightleft\<CR>") endif + call term_sendkeys(buf, ":set pummaxwidth=16\<CR>") + call TermWait(buf, 50) + call term_sendkeys(buf, "S\<C-X>\<C-O>") + call VerifyScreenDump(buf, 'Test_pum_maxwidth_21', {'rows': 8}) + call term_sendkeys(buf, "\<ESC>") + + if has('rightleft') + call term_sendkeys(buf, ":set rightleft\<CR>") + call TermWait(buf, 50) + call term_sendkeys(buf, "S\<C-X>\<C-O>") + call VerifyScreenDump(buf, 'Test_pum_maxwidth_22', {'rows': 8}) + call term_sendkeys(buf, "\<Esc>:set norightleft\<CR>") + endif + call StopVimInTerminal(buf) endfunc