diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | autoload/deoplete/handler.vim | 17 | ||||
-rw-r--r-- | autoload/deoplete/init.vim | 4 | ||||
-rw-r--r-- | autoload/deoplete/mapping.vim | 2 | ||||
-rw-r--r-- | autoload/deoplete/util.vim | 4 | ||||
-rw-r--r-- | doc/deoplete.txt | 4 |
6 files changed, 15 insertions, 18 deletions
@@ -29,7 +29,7 @@ Here are some [completion sources](https://github.com/Shougo/deoplete.nvim/wiki/ ## Install **Note:** deoplete requires Neovim (0.3.0+ and of course, **latest** is -recommended) or Vim8 with Python 3.6.1+ and timers enabled. See +recommended) or Vim8.1 with Python 3.6.1+ and timers enabled. See [requirements](#requirements) if you aren't sure whether you have this. Note: deoplete requires msgpack package 1.0.0+. 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 diff --git a/autoload/deoplete/init.vim b/autoload/deoplete/init.vim index 393240b..d8a5a05 100644 --- a/autoload/deoplete/init.vim +++ b/autoload/deoplete/init.vim @@ -49,8 +49,8 @@ function! deoplete#init#_channel() abort call deoplete#util#print_error('deoplete requires nvim 0.3.0+.') return 1 endif - if !has('nvim') && v:version < 800 - call deoplete#util#print_error('deoplete requires Vim 8.0+.') + if !has('nvim') && v:version < 801 + call deoplete#util#print_error('deoplete requires Vim 8.1+.') return 1 endif diff --git a/autoload/deoplete/mapping.vim b/autoload/deoplete/mapping.vim index fe6869c..ca299d1 100644 --- a/autoload/deoplete/mapping.vim +++ b/autoload/deoplete/mapping.vim @@ -48,7 +48,7 @@ function! deoplete#mapping#_complete() abort if !has_key(g:deoplete#_context, 'candidates') \ || s:check_completion_info(g:deoplete#_context.candidates) \ || !&modifiable - let g:deoplete#_context.candidates = [] + call complete(1, []) return '' endif diff --git a/autoload/deoplete/util.vim b/autoload/deoplete/util.vim index 51292df..96215b2 100644 --- a/autoload/deoplete/util.vim +++ b/autoload/deoplete/util.vim @@ -35,10 +35,6 @@ function! deoplete#util#get_input(event) abort \ '^.*\%' . (mode ==# 'i' ? col('.') : col('.') - 1) \ . 'c' . (mode ==# 'i' ? '' : '.')) - if a:event ==# 'InsertCharPre' - let input .= v:char - endif - return input endfunction function! deoplete#util#get_next_input(event) abort diff --git a/doc/deoplete.txt b/doc/deoplete.txt index af1105d..9a87d7d 100644 --- a/doc/deoplete.txt +++ b/doc/deoplete.txt @@ -45,8 +45,8 @@ Improvements in deoplete in comparison to |neocomplete|: ============================================================================== INSTALL *deoplete-install* -Note: deoplete requires Neovim (0.3.0+) or Vim8 (latest is recommended) with -Python 3.6.1+ and |+timers| enabled. +Note: deoplete requires Neovim (0.3.0+) or Vim8.1+ (latest is recommended) +with Python 3.6.1+ and |+timers| enabled. Please install/upgrade msgpack package (1.0.0+). https://github.com/msgpack/msgpack-python |