From daab1a08db7bc0436186751456ebd5b9a32c24f9 Mon Sep 17 00:00:00 2001 From: w0rp Date: Thu, 26 Jul 2018 23:08:38 +0100 Subject: #1700 - Try using a 0ms timer showing the completion menu --- test/completion/test_completion_events.vader | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/completion/test_completion_events.vader b/test/completion/test_completion_events.vader index dfffab61..3f0bfa70 100644 --- a/test/completion/test_completion_events.vader +++ b/test/completion/test_completion_events.vader @@ -125,32 +125,38 @@ Execute(ale#completion#Show() should remember the omnifunc setting and replace i let &l:omnifunc = 'FooBar' call ale#completion#Show('Response', 'Parser') - AssertEqual [["\(ale_show_completion_menu)"]], g:feedkeys_calls - call ale#completion#TriggerOmnicompleteMenu() AssertEqual 'FooBar', b:ale_old_omnifunc AssertEqual 'ale#completion#OmniFunc', &l:omnifunc + AssertEqual [], g:feedkeys_calls + sleep 1ms + AssertEqual [["\(ale_show_completion_menu)"]], g:feedkeys_calls + Execute(ale#completion#Show() should remember the completeopt setting and replace it): let &l:completeopt = 'menu' call ale#completion#Show('Response', 'Parser') - AssertEqual [["\(ale_show_completion_menu)"]], g:feedkeys_calls - call ale#completion#TriggerOmnicompleteMenu() AssertEqual 'menu', b:ale_old_completopt AssertEqual 'menu,menuone,noselect,noinsert', &l:completeopt + AssertEqual [], g:feedkeys_calls + sleep 1ms + AssertEqual [["\(ale_show_completion_menu)"]], g:feedkeys_calls + Execute(ale#completion#Show() should set the preview option if it's set): let &l:completeopt = 'menu,preview' call ale#completion#Show('Response', 'Parser') - AssertEqual [["\(ale_show_completion_menu)"]], g:feedkeys_calls - call ale#completion#TriggerOmnicompleteMenu() AssertEqual 'menu,preview', b:ale_old_completopt AssertEqual 'menu,menuone,preview,noselect,noinsert', &l:completeopt + AssertEqual [], g:feedkeys_calls + sleep 1ms + AssertEqual [["\(ale_show_completion_menu)"]], g:feedkeys_calls + Execute(ale#completion#OmniFunc() should also remember the completeopt setting and replace it): let &l:completeopt = 'menu' @@ -170,6 +176,8 @@ Execute(ale#completion#OmniFunc() should set the preview option if it's set): Execute(ale#completion#Show() should make the correct feedkeys() call): call ale#completion#Show('Response', 'Parser') + AssertEqual [], g:feedkeys_calls + sleep 1ms AssertEqual [["\(ale_show_completion_menu)"]], g:feedkeys_calls Execute(ale#completion#Show() shouldn't do anything if you switch back to normal mode): -- cgit v1.2.3