Regression with commit 'b88179d'
The latest commit (b88179d) introduced a regression.
To reproduce, create a file with the following contents:
hello
h
Then on the last line type e. The word hello is not proposed.
However if you do the same at commit b8f00ea it works as expected.
I managed to fix it locally by faking a BufWinEnter event on the buffer source like so:
autocmd User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#buffer#get_source_options({
\ 'name': 'buffer',
\ 'allowlist': ['*'],
\ 'blocklist': [],
\ 'completor': function('asyncomplete#sources#buffer#completor'),
\ 'config': {
\ 'max_buffer_size': 5000000,
\ },
\ }))
" fix for https://github.com/prabirshrestha/asyncomplete-buffer.vim/issues/17
function! s:fix_buffer_complete() abort
let l:info = asyncomplete#get_source_info('buffer')
call l:info.on_event(l:info, {}, 'BufWinEnter')
endfunction
autocmd User asyncomplete_setup call s:fix_buffer_complete()
It seems that the event BufWinEnter is not generated when you start vim with a file. A proper fix for the plugin would be to process not only BufWinEnter, but also VimEnter.
I have found a workaround for this issue by adding this to my vimrc (I am not sure if this is the right approach):
autocmd VimEnter * :doautocmd BufWinEnter