diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua index e910cb7d8ed..ec0d0c62661 100644 --- a/test/functional/ui/popupmenu_spec.lua +++ b/test/functional/ui/popupmenu_spec.lua @@ -6334,6 +6334,71 @@ describe('builtin popupmenu', function() end feed('') command('set norightleft') + + command('set pummaxwidth=16') + feed('S') + 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('') + + command('set rightleft') + feed('S') + 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:') + 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 index bc727d1b0ac..8f65d768ce9 100644 --- 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, "\:set norightleft\") endif + call term_sendkeys(buf, ":set pummaxwidth=16\") + call TermWait(buf, 50) + call term_sendkeys(buf, "S\\") + call VerifyScreenDump(buf, 'Test_pum_maxwidth_21', {'rows': 8}) + call term_sendkeys(buf, "\") + + if has('rightleft') + call term_sendkeys(buf, ":set rightleft\") + call TermWait(buf, 50) + call term_sendkeys(buf, "S\\") + call VerifyScreenDump(buf, 'Test_pum_maxwidth_22', {'rows': 8}) + call term_sendkeys(buf, "\:set norightleft\") + endif + call StopVimInTerminal(buf) endfunc