-
Notifications
You must be signed in to change notification settings - Fork 49
Don't show autocompletion popup after navigation keystrokes #208
Comments
Also, it would be nice for NCM to behave like this: if nothing is selected in the autocompletion popup and I press <CR>, it should close the popup and insert newline. Currently it just closes the popup without adding a newline. |
It is not nvim-completion-manager issue. inoremap <silent> <expr><CR> pumvisible() ? "\<C-e>\<CR>" : "\<CR>" Note: You cannot specify |
Thanks @Shougo! But the issue described in the 1st comment should be possible to resolve, right? |
I have read the implementation and it is already implemented. So what is the problem?
If you want to move the cursor when the popup menu visible, here. inoremap <silent> <expr><Up> pumvisible() ? "\<C-e>\<Up>" : "\<Up>" It is not nvim-completion-manager problem. |
@Shougo the problem is this: I want autocompletion popup only when I'm typing something, not when I'm moving cursor around. Also, when the popup is visible, I want arrows to select a candidate.
Alas, I had to move away from deoplete and now in a search of a completion plugin that works for me. Right now I'm using mucomplete which does not have the issue described in this bug. But there's no fuzzy search in mucomplete, and will never be. |
I have researched nvim-completion-manager code. |
@Shougo edit this file with NCM enabled:
Now enter insert mode with cursor at (1, 1) and press <right> 3-4 times. Autocompletion popup will appear in the middle of abcdefg. Why?! I'm not typing anything. |
OK. Reproduced. I will check nvim-completion-manager implementation. If you can reproduce the problem with deoplete, please tell me. |
I have got the reason. nvim-completion-manager checks the cursor position using timer feature.
The behavior is feature. It is the patch to fix the behavior. diff --git a/autoload/cm.vim b/autoload/cm.vim
index 115b96f..01bf842 100644
--- a/autoload/cm.vim
+++ b/autoload/cm.vim
@@ -443,7 +443,7 @@ func! s:on_insert_enter()
endif
let s:lasttick = s:changetick()
" check changes every 30ms, which is 0.03s, it should be fast enough
- let s:change_timer = timer_start(30,function('s:check_changes'),{'repeat':-1})
+ " let s:change_timer = timer_start(30,function('s:check_changes'),{'repeat':-1})
call s:on_changed()
endfunc Note: There may be side effects |
I can verify that using left right arrows in asyncomplete.vim shows popup if it is closed with timer but not with These are the two commits that are needed to be ported. prabirshrestha/asyncomplete.vim@6a9a0e6 and prabirshrestha/asyncomplete.vim@720be50 |
I think Yes. deoplete already supports TextChangedP. Note: neovim does not support TextChangedP yet. |
@Shougo I don't have this specific problem with deoplete, but I do have several others. Apart from performance and stability issues that I've been having recently, I was never able to set it up to work with tags reliably. Looking at the speed at which mucomplete and NCM can offer candidates for tags completion, I simply can't live with deoplete. |
If deoplete does not work with tags, please create the issue in deoplete. I will check it. |
@Shougo it works... but the wait time for tags candidates to appear in the popup is many seconds. In NCM and mucomplete it's instantly. If you know how NCM does it, then deoplete should behave this way too. |
OK. I get it. In nvim-completion-manager, it uses binary search. It is faster, but fuzzy match does not work. |
@Shougo fuzzy search does work for tags in NCM, at least to some extent. For example "PrintCMS" string matches "PrintCacheMaxSizes" candidate. |
https://github.com/roxma/nvim-completion-manager/blob/master/pythonx/cm_sources/cm_tags.py#L36 ncm uses |
I wonder why you guys use Python for performance-critical code like fuzzy matching?.. Speed has never been a strong side of Python. |
Because, Python performance is not so bad. |
I'm pretty sure it's hard to achieve the same level of performance as fzf in pure Python. |
If I'm in insert mode and just move the cursor around using <left>, <right>, <up>, <down>, <home>, <end>, and so on - autocompletion menu still pops up and interferes with my cursor movement (if there's something to complete under cursor). Is it possible to make the completion popup window only show up after I type letters, dot or colon? Thanks!
The text was updated successfully, but these errors were encountered: