diff options
author | w0rp <devw0rp@gmail.com> | 2018-07-04 08:52:08 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2018-07-04 08:52:18 +0100 |
commit | ca7fa31c619e9f259dd39eadc3b4b2c5bbaa4eba (patch) | |
tree | 5c09f1082fb382d721c6e8b2a6bd6bcc6b76263c /test | |
parent | db85b931ec83de3382b75b7e9a18f1cf8ae8ce43 (diff) | |
download | ale-ca7fa31c619e9f259dd39eadc3b4b2c5bbaa4eba.zip |
Close #1690 - Respect the preview setting for completeopt
Diffstat (limited to 'test')
-rw-r--r-- | test/completion/test_completion_events.vader | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/test/completion/test_completion_events.vader b/test/completion/test_completion_events.vader index fbe18bb6..96182013 100644 --- a/test/completion/test_completion_events.vader +++ b/test/completion/test_completion_events.vader @@ -9,6 +9,8 @@ Before: let g:get_completions_called = 0 let g:feedkeys_calls = [] + let &l:completeopt = 'menu,menuone,preview,noselect,noinsert' + runtime autoload/ale/util.vim function! ale#util#FeedKeys(string, mode) abort @@ -95,6 +97,14 @@ Execute(ale#completion#Show() should remember the completeopt setting and replac call ale#completion#Show('Response', 'Parser') AssertEqual 'menu', b:ale_old_completopt + AssertEqual 'menu,menuone,noselect,noinsert', &l:completeopt + +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 'menu,preview', b:ale_old_completopt AssertEqual 'menu,menuone,preview,noselect,noinsert', &l:completeopt Execute(ale#completion#OmniFunc() should also remember the completeopt setting and replace it): @@ -103,6 +113,14 @@ Execute(ale#completion#OmniFunc() should also remember the completeopt setting a call ale#completion#OmniFunc(0, '') AssertEqual 'menu', b:ale_old_completopt + AssertEqual 'menu,menuone,noselect,noinsert', &l:completeopt + +Execute(ale#completion#OmniFunc() should set the preview option if it's set): + let &l:completeopt = 'menu,preview' + + call ale#completion#OmniFunc(0, '') + + AssertEqual 'menu,preview', b:ale_old_completopt AssertEqual 'menu,menuone,preview,noselect,noinsert', &l:completeopt Execute(ale#completion#Show() should make the correct feedkeys() call): @@ -127,7 +145,6 @@ Execute(ale#completion#Done() should restore old omnifunc values): Execute(ale#completion#Done() should restore the old completeopt setting): let b:ale_old_completopt = 'menu' - let &l:completeopt = 'menu,menuone,preview,noselect,noinsert' call ale#completion#Done() |