aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-02-03 20:31:06 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2019-02-03 20:43:23 +0100
commit81ac8e9015142fb539ad888651130f6a0ab0b27a (patch)
treeeccd83e9b0deec7a47218559b20641151af454cf
parent79a0ea2bec7c4a1c82990c07c87098b87bc2a1da (diff)
downloadrneovim-81ac8e9015142fb539ad888651130f6a0ab0b27a.tar.gz
rneovim-81ac8e9015142fb539ad888651130f6a0ab0b27a.tar.bz2
rneovim-81ac8e9015142fb539ad888651130f6a0ab0b27a.zip
popupmenu: fix alignment of kind and extra after #9530
-rw-r--r--src/nvim/popupmnu.c2
-rw-r--r--test/functional/ui/popupmenu_spec.lua51
2 files changed, 52 insertions, 1 deletions
diff --git a/src/nvim/popupmnu.c b/src/nvim/popupmnu.c
index d64406846a..eac413f6ba 100644
--- a/src/nvim/popupmnu.c
+++ b/src/nvim/popupmnu.c
@@ -517,7 +517,7 @@ void pum_redraw(void)
} else {
grid_fill(&pum_grid, row, row + 1, col,
col_off + pum_base_width + n, ' ', ' ', attr);
- col = pum_base_width + n;
+ col = col_off + pum_base_width + n;
}
totwidth = pum_base_width + n;
}
diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua
index 9e6a61f4d0..6a10f60ad8 100644
--- a/test/functional/ui/popupmenu_spec.lua
+++ b/test/functional/ui/popupmenu_spec.lua
@@ -1178,5 +1178,56 @@ describe('builtin popupmenu', function()
]])
end)
+ it('works with kind, menu and abbr attributes', function()
+ screen:try_resize(40,8)
+ feed('ixx ')
+ funcs.complete(4, {{word='wordey', kind= 'x', menu='extrainfo'}, 'thing', {word='secret', abbr='sneaky', menu='bar'}})
+ screen:expect([[
+ xx wordey^ |
+ {1:~ }{s: wordey x extrainfo }{1: }|
+ {1:~ }{n: thing }{1: }|
+ {1:~ }{n: sneaky bar }{1: }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {2:-- INSERT --} |
+ ]])
+
+ feed('<c-p>')
+ screen:expect([[
+ xx ^ |
+ {1:~ }{n: wordey x extrainfo }{1: }|
+ {1:~ }{n: thing }{1: }|
+ {1:~ }{n: sneaky bar }{1: }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {2:-- INSERT --} |
+ ]])
+
+ feed('<c-p>')
+ screen:expect([[
+ xx secret^ |
+ {1:~ }{n: wordey x extrainfo }{1: }|
+ {1:~ }{n: thing }{1: }|
+ {1:~ }{s: sneaky bar }{1: }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {2:-- INSERT --} |
+ ]])
+
+ feed('<esc>')
+ screen:expect([[
+ xx secre^t |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ |
+ ]])
+ end)
end)