Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression with commit 'b88179d' #17

Open
ipkiss42 opened this issue Mar 7, 2020 · 2 comments
Open

Regression with commit 'b88179d' #17

ipkiss42 opened this issue Mar 7, 2020 · 2 comments

Comments

@ipkiss42
Copy link

ipkiss42 commented Mar 7, 2020

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.

omgitsmoe added a commit to omgitsmoe/asyncomplete-buffer.vim that referenced this issue May 2, 2021
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
@ferreum
Copy link

ferreum commented Jul 13, 2022

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()

@jcomesana
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants