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

031919c7ac
This commit is contained in:
zeertzjq
2025-04-16 07:49:16 +08:00
parent 54d6055098
commit afca5b564e
2 changed files with 79 additions and 0 deletions

View File

@@ -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()

View File

@@ -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