summaryrefslogtreecommitdiff
path: root/autoload/deoplete/handler.vim
diff options
context:
space:
mode:
authorShougo Matsushita <Shougo.Matsu@gmail.com>2020-10-14 15:06:21 +0900
committerShougo Matsushita <Shougo.Matsu@gmail.com>2020-10-14 15:06:21 +0900
commita072a68357b464a2d31e794f63848707b312d67b (patch)
tree15b00a6900fba9f487ac280a3a4f6de2d95cf803 /autoload/deoplete/handler.vim
parentc41ee14637f62404658567870caf7b507f0b9014 (diff)
downloaddeoplete.nvim-a072a68357b464a2d31e794f63848707b312d67b.zip
Fix BS flickers and require Vim 8.1+
Diffstat (limited to 'autoload/deoplete/handler.vim')
-rw-r--r--autoload/deoplete/handler.vim17
1 files changed, 9 insertions, 8 deletions
diff --git a/autoload/deoplete/handler.vim b/autoload/deoplete/handler.vim
index 8f99e14..0c6812c 100644
--- a/autoload/deoplete/handler.vim
+++ b/autoload/deoplete/handler.vim
@@ -26,11 +26,7 @@ function! deoplete#handler#_init() abort
call s:define_completion_via_timer('InsertEnter')
endif
if deoplete#custom#_get_option('refresh_always')
- if exists('##TextChangedP')
- call s:define_completion_via_timer('TextChangedP')
- else
- call s:define_completion_via_timer('InsertCharPre')
- endif
+ call s:define_completion_via_timer('TextChangedP')
endif
" Note: Vim 8 GUI(MacVim and Win32) is broken
@@ -204,11 +200,16 @@ function! deoplete#handler#_completion_begin(event) abort
call deoplete#util#rpcnotify(
\ 'deoplete_auto_completion_begin', {'event': a:event})
+ " For <BS> popup flicker
let auto_popup = deoplete#custom#_get_option(
\ 'auto_complete_popup') !=# 'manual'
- if auto_popup || deoplete#util#check_popup()
- " For popup flicker
- "call feedkeys("\<Plug>_", 'i')
+ let prev_input = get(g:deoplete#_context, 'input', '')
+ let cur_input = deoplete#util#get_input(a:event)
+ if auto_popup && empty(v:completed_item)
+ \ && cur_input !=# prev_input
+ \ && len(cur_input) + 1 ==# len(prev_input)
+ \ && stridx(prev_input, cur_input) == 0
+ call feedkeys("\<Plug>_", 'i')
endif
endfunction
function! s:is_skip(event) abort