Shougo / neocomplcache.vim

Ultimate auto-completion system for Vim.
http://www.vim.org/scripts/script.php?script_id=2620
1.72k stars 135 forks source link

Maybe this is why the candidate menu flick #426

Closed UncleBill closed 11 years ago

UncleBill commented 11 years ago

I set

let g:neocomplcache_enable_auto_select = 1

But the odd selecting behavior:

1.First, I type he, and the menu pops up

Imgur

2.automaticly select the 1st match

Imgur

3.then, "head" becomes "he" again ( update) Imgur


3 steps make it flick

Shougo commented 11 years ago

3.then, release it,

What's the release? Please tell me the keymappings in detail.

I think you should map to <C-e> and <C-y>.

inoremap <expr><C-y>  pumvisible() ? neocomplete#close_popup() :  "\<C-r>\""

inoremap <expr><C-e>  pumvisible() ? neocomplete#cancel_popup() : "\<End>"
UncleBill commented 11 years ago

What's the release?

"head" turn back "he"

UncleBill commented 11 years ago

I re-edited it

UncleBill commented 11 years ago

I think you should map to and .

I tried that, it still flicks. problem is:

  1. I type "he"
  2. ["head","heart","heat".etc] poped up
  3. "head" is automaticly select, "head", the whole word appended to file Imgur
  4. soonly, "head" becomes "he", automaticly Imgur
Shougo commented 11 years ago

OK. This is Vim's feature. Because, neocomplcache/neocomplete.vim uses keymappings hacks. Like this:

  return  !pumvisible() ? "" :
        \ g:neocomplete#enable_auto_select ? "\<C-p>\<Down>" :
        \ "\<C-p>"

If neocomplcache/neocomplete.vim opens popup menu, the first candidate is automatically selected. But it is not intended behavior for auto completion. So auto completion plugins uses the hack like "". But if your Vim is too slow, it flicks. It is Vim's feature. I cannot fix it.

Shougo commented 11 years ago

But I and Nayuri Aohime developped this patch. https://groups.google.com/forum/?hl=ja&fromgroups#!topic/vim_dev/tVsk0pdOGvs if you apply this patch, this behavior is fixed in neocomplete.vim. So, you may support this patch in vim_dev. Because, Mr.Bram does not responce to it...

UncleBill commented 11 years ago

But if your Vim is too slow, it flicks. It is Vim's feature. I cannot fix it.

got it

Shougo commented 9 years ago

The patch is already todo listed in long time...