aboutsummaryrefslogtreecommitdiff
path: root/test/functional/viml/completion_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2016-03-16 21:43:51 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2016-03-17 13:26:51 +0100
commit5aa0159f013e58291e24dc391b2ae9db3badd68a (patch)
tree1789b72b211eae7cdfb63fe0903770a049ccaa73 /test/functional/viml/completion_spec.lua
parentc94575fded78be1c9fca8b7d193c9bbb30a1dc95 (diff)
downloadrneovim-5aa0159f013e58291e24dc391b2ae9db3badd68a.tar.gz
rneovim-5aa0159f013e58291e24dc391b2ae9db3badd68a.tar.bz2
rneovim-5aa0159f013e58291e24dc391b2ae9db3badd68a.zip
edit.c: K_EVENT should not hide the popupmenu
Nor should K_FOCUSGAINED and K_FOCUSLOST.
Diffstat (limited to 'test/functional/viml/completion_spec.lua')
-rw-r--r--test/functional/viml/completion_spec.lua59
1 files changed, 56 insertions, 3 deletions
diff --git a/test/functional/viml/completion_spec.lua b/test/functional/viml/completion_spec.lua
index 45dbbdb7c7..20eee24524 100644
--- a/test/functional/viml/completion_spec.lua
+++ b/test/functional/viml/completion_spec.lua
@@ -1,5 +1,6 @@
local helpers = require('test.functional.helpers')
+local Screen = require('test.functional.ui.screen')
local clear, feed = helpers.clear, helpers.feed
local eval, eq, neq = helpers.eval, helpers.eq, helpers.neq
local execute, source, expect = helpers.execute, helpers.source, helpers.expect
@@ -143,8 +144,60 @@ describe('completion', function()
end)
it('disables folding during completion', function ()
- execute("set foldmethod=indent")
- feed('i<Tab>foo<CR><Tab>bar<Esc>ggA<C-x><C-l>')
- eq(-1, eval('foldclosed(1)'))
+ execute("set foldmethod=indent")
+ feed('i<Tab>foo<CR><Tab>bar<Esc>ggA<C-x><C-l>')
+ eq(-1, eval('foldclosed(1)'))
end)
+
+ it('popupmenu is not interrupted by events', function ()
+ local screen = Screen.new(40, 8)
+ screen:attach()
+ screen:set_default_attr_ignore({{bold=true, foreground=Screen.colors.Blue}})
+ screen:set_default_attr_ids({
+ [1] = {background = Screen.colors.LightMagenta},
+ [2] = {background = Screen.colors.Grey},
+ [3] = {bold = true},
+ [4] = {bold = true, foreground = Screen.colors.SeaGreen},
+ })
+
+ feed('ifoobar fooegg<cr>f<c-p>')
+ screen:expect([[
+ foobar fooegg |
+ fooegg^ |
+ {1:foobar } |
+ {2:fooegg } |
+ ~ |
+ ~ |
+ ~ |
+ {3:-- }{4:match 1 of 2} |
+ ]])
+
+ eval('1 + 1')
+ -- popupmenu still visible
+ screen:expect([[
+ foobar fooegg |
+ fooegg^ |
+ {1:foobar } |
+ {2:fooegg } |
+ ~ |
+ ~ |
+ ~ |
+ {3:-- }{4:match 1 of 2} |
+ ]])
+
+ feed('<c-p>')
+ -- Didn't restart completion: old matches still used
+ screen:expect([[
+ foobar fooegg |
+ foobar^ |
+ {2:foobar } |
+ {1:fooegg } |
+ ~ |
+ ~ |
+ ~ |
+ {3:-- }{4:match 2 of 2} |
+ ]])
+ end)
+
end)
+