Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
previously the word list would only get updated when (re-)entering or saving a buffer
so words that were typed recently wouldn't show up in completions
now words are refreshed after ther cursor paused for
updatetime (4000ms default) amount
  • Loading branch information
omgitsmoe committed May 2, 2021
1 parent 975b4f1 commit 9700377
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion autoload/asyncomplete/sources/buffer.vim
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ function! asyncomplete#sources#buffer#completor(info, ctx)
endfunction

function! asyncomplete#sources#buffer#get_source_options(opts)
" events where the word lists gets updated
" could add 'TextChangedI' but might cause performance problems and we
" already have CursorHoldI which updates after cursor paused for
" 'updatetime' amount
return extend({
\ 'priority': 10,
\ 'events': ['BufEnter', 'BufWritePost'],
\ 'events': ['CursorHold', 'CursorHoldI', 'BufEnter', 'BufWritePost'],
\ 'on_event': function('s:on_event'),
\}, a:opts)
endfunction
Expand Down

0 comments on commit 9700377

Please sign in to comment.