diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-11-13 23:09:57 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-13 23:09:57 -0500 |
commit | d8c69adbabe963142f433a2ddad172ff46413f15 (patch) | |
tree | 286aa67984fa18395c77a872b8d088ddca3e5348 /test/functional/ui/popupmenu_spec.lua | |
parent | 7c4f349661bd7e66f22b3a0903ffb7b8db1222e7 (diff) | |
parent | f1bd2c1dd9d7b0de0a291c690d828a112f8b6cae (diff) | |
download | rneovim-d8c69adbabe963142f433a2ddad172ff46413f15.tar.gz rneovim-d8c69adbabe963142f433a2ddad172ff46413f15.tar.bz2 rneovim-d8c69adbabe963142f433a2ddad172ff46413f15.zip |
Merge pull request #12698 from erw7/fix-popupmenu-with-rl
ui: fix problem with the popupmenu when rightleft is set
Diffstat (limited to 'test/functional/ui/popupmenu_spec.lua')
-rw-r--r-- | test/functional/ui/popupmenu_spec.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua index 3f984ff943..0944bfc21a 100644 --- a/test/functional/ui/popupmenu_spec.lua +++ b/test/functional/ui/popupmenu_spec.lua @@ -9,6 +9,7 @@ local funcs = helpers.funcs local get_pathsep = helpers.get_pathsep local eq = helpers.eq local pcall_err = helpers.pcall_err +local eval = helpers.eval describe('ui/ext_popupmenu', function() local screen @@ -2196,4 +2197,20 @@ describe('builtin popupmenu', function() {2:-- INSERT --} | ]]) end) + + it('does not crash when displayed in the last column with rightleft (#12032)', function() + local col = 30 + local items = {'word', 'choice', 'text', 'thing'} + local max_len = 0 + for _, v in ipairs(items) do + max_len = max_len < #v and #v or max_len + end + screen:try_resize(col, 8) + command('set rightleft') + command('call setline(1, repeat(" ", &columns - '..max_len..'))') + feed('$i') + funcs.complete(col - max_len, items) + feed('<c-y>') + eq(2, eval('1+1')) + end) end) |