summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-10-26 23:18:12 +0100
committerw0rp <devw0rp@gmail.com>2017-10-26 23:18:12 +0100
commit6490d3a5e69c188cbd2b2206916f98409cfb230c (patch)
treef4616b58024b934a713deb8ce2763ed57e7fea04 /autoload
parent33c2c20e66f694daf899963d778c47f824cda732 (diff)
downloadale-6490d3a5e69c188cbd2b2206916f98409cfb230c.zip
Fix #1041 - Do not request completions shortly after CompleteDone
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/completion.vim10
1 files changed, 10 insertions, 0 deletions
diff --git a/autoload/ale/completion.vim b/autoload/ale/completion.vim
index 9f4e3c28..90c9ae29 100644
--- a/autoload/ale/completion.vim
+++ b/autoload/ale/completion.vim
@@ -283,6 +283,13 @@ function! s:TimerHandler(...) abort
endfunction
function! ale#completion#Queue() abort
+ let l:time = get(b:, 'ale_complete_done_time', 0)
+
+ if l:time && ale#util#ClockMilliseconds() - l:time < 100
+ " Do not ask for completions shortly after we just closed the menu.
+ return
+ endif
+
let s:timer_pos = getcurpos()[1:2]
" If we changed the text again while we're still waiting for a response,
@@ -311,6 +318,9 @@ function! ale#completion#Done() abort
let &l:completeopt = b:ale_old_completopt
unlet b:ale_old_completopt
endif
+
+ " Set a timestamp, so we can avoid requesting completions again.
+ let b:ale_complete_done_time = ale#util#ClockMilliseconds()
endfunction
function! s:Setup(enabled) abort