From ee6dabcc4e2f64c7a035a2e7da3bc13285013d88 Mon Sep 17 00:00:00 2001 From: w0rp Date: Fri, 21 Jul 2017 14:55:26 +0100 Subject: [PATCH] Don't mess with compleopt for each completion, as it doesn't work --- autoload/ale/completion.vim | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/autoload/ale/completion.vim b/autoload/ale/completion.vim index 0ad0f6a5..17389a3f 100644 --- a/autoload/ale/completion.vim +++ b/autoload/ale/completion.vim @@ -102,21 +102,15 @@ function! ale#completion#Show(response, completion_parser) abort " Remember the old omnifunc value, if there is one. " If we don't store an old one, we'll just never reset the option. " This will stop some random exceptions from appearing. - if !exists('b:ale_old_omnifunc') && !empty(&omnifunc) - let b:ale_old_omnifunc = &omnifunc - endif - - " Remember the old completion options, if they are set. - if !exists('b:ale_old_completeopt') && !empty(&completeopt) - let b:ale_old_completeopt = &completeopt + if !exists('b:ale_old_omnifunc') && !empty(&l:omnifunc) + let b:ale_old_omnifunc = &l:omnifunc endif " Set the list in the buffer, temporarily replace omnifunc with our " function, and then start omni-completion. let b:ale_completion_response = a:response let b:ale_completion_parser = a:completion_parser - let &omnifunc = 'ale#completion#OmniFunc' - let &completeopt = 'menu,noinsert,noselect' + let &l:omnifunc = 'ale#completion#OmniFunc' call feedkeys("\\", 'n') endfunction @@ -306,14 +300,9 @@ function! ale#completion#Done() abort " Reset settings when completion is done. if exists('b:ale_old_omnifunc') - let &omnifunc = b:ale_old_omnifunc + let &l:omnifunc = b:ale_old_omnifunc unlet b:ale_old_omnifunc endif - - if exists('b:ale_old_completeopt') - let &completeopt = b:ale_old_completeopt - unlet b:ale_old_completeopt - endif endfunction function! s:Setup(enabled) abort