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

No completions after change in insert mode #800

Closed
blueyed opened this issue Jul 11, 2018 · 6 comments
Closed

No completions after change in insert mode #800

blueyed opened this issue Jul 11, 2018 · 6 comments

Comments

@blueyed
Copy link
Contributor

blueyed commented Jul 11, 2018

Given t.txt:

foo
foobar

And a minimal vimrc:

set runtimepath+=~/.vim/plugged/deoplete.nvim
let g:deoplete#enable_at_startup = 1
call deoplete#enable_logging('DEBUG', '/tmp/deoplete.log')

call deoplete#custom#source('buffer', 'is_debug_enabled', 1)
let g:deoplete#num_processes = 1

call deoplete#custom#option('sources', {
\ '_': ['buffer'],
\})

Starting neovim with nvim -u vimrc.minimal t.txt:

  1. press A to append to the first line
  2. it shows "foo" and "foobar" as completions
    (3. You can repeat <Esc> and a now, it will keep repeating)
  3. insert n
  4. the pum will be closed, and the first line is foon now

deoplete is now stuck:

  1. backspace will keep "foo", and not offer completions
  2. leaving insert mode (<esc>) and using a again will also show no completions

You have to edit the "foo" itself to make it work again.

It looks like a problem in Deoplete._merge_results, but it is not clear to me.

@blueyed
Copy link
Contributor Author

blueyed commented Jul 11, 2018

Tried to bisect, but had to skip a lot due to other issues (i.e. completion was not working at all):

There are only 'skip'ped commits left to test.
The first bad commit could be any of:
700b7f8
ce51f0c
dedcb83
389b625
38b9a65
ab9d231
b299e7d
4fbe097
572fa2c
f3663f1

Seems to be related to the multi-processing in general.

@blueyed
Copy link
Contributor Author

blueyed commented Jul 14, 2018

The first issue (backspace will keep "foo", and not offer completions) can be fixed in Vim/Neovim itself: vim/vim#3193

blueyed added a commit to blueyed/deoplete.nvim that referenced this issue Jul 14, 2018
blueyed added a commit to blueyed/deoplete.nvim that referenced this issue Jul 14, 2018
@Shougo Shougo closed this as completed in 1fe1e88 Jul 16, 2018
@Shougo
Copy link
Owner

Shougo commented Jul 16, 2018

Fixed.

@Shougo
Copy link
Owner

Shougo commented Jul 16, 2018

The first issue (backspace will keep "foo", and not offer completions) can be fixed in Vim/Neovim itself: vim/vim#3193

I don't understand the problem...

blueyed added a commit to blueyed/deoplete.nvim that referenced this issue Jul 16, 2018
@blueyed
Copy link
Contributor Author

blueyed commented Jul 16, 2018

Fixed.

Thanks. ´test_800` confirms this (https://github.com/Shougo/deoplete.nvim/pull/807/files#diff-e054dcb6b027ec2cc2fd7a4c6ecf5f5fR102), but needs a sleep for some reason - see the other test above.

vim/vim#3193 is about handling completions via complete() more similar to other completions, i.e. using backspace does not close them.
I am not yet sure if this is good or bad for deoplete though - it might need some form of notification? I do not remember if there are events then (since CompleteDone is not emitted for the closed pum).

@Shougo
Copy link
Owner

Shougo commented Jul 18, 2018

but needs a sleep for some reason - see the other test above.

I think the completion is async and parallel.

vim/vim#3193 is about handling completions via complete() more similar to other completions, i.e. using backspace does not close them.

For deoplete, the feature is not useful.
Because deoplete must re-generate candidates when you press <BS>.
So you need to remap <BS> key like this.

inoremap <expr><BS> deoplete#smart_close_popup()."\<C-h>"

blueyed added a commit to blueyed/deoplete.nvim that referenced this issue May 29, 2019
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

2 participants