diff options
author | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2020-04-28 20:40:19 +0900 |
---|---|---|
committer | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2020-04-28 20:40:19 +0900 |
commit | 2902c3780aaa497ecf7bfd9d3e53c15f6481afeb (patch) | |
tree | 3601a0b8766b58adfb3ab6913cee0539a2f4674b /autoload/deoplete/handler.vim | |
parent | 6a3f33fee694b61ccd57e986397aae9481ef013c (diff) | |
download | deoplete.nvim-2902c3780aaa497ecf7bfd9d3e53c15f6481afeb.zip |
Fix <C-y> regression
Diffstat (limited to 'autoload/deoplete/handler.vim')
-rw-r--r-- | autoload/deoplete/handler.vim | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/autoload/deoplete/handler.vim b/autoload/deoplete/handler.vim index 9ba2d37..5d766e7 100644 --- a/autoload/deoplete/handler.vim +++ b/autoload/deoplete/handler.vim @@ -216,6 +216,11 @@ function! s:is_skip(event) abort return 1 endif + " Note: The check is needed for <C-y> mapping + if s:is_skip_prev_text(a:event) + return 1 + endif + if s:is_skip_text(a:event) " Close the popup if deoplete#util#check_popup() @@ -236,6 +241,23 @@ function! s:is_skip(event) abort return 0 endfunction +function! s:is_skip_prev_text(event) abort + let input = deoplete#util#get_input(a:event) + + " Note: Use g:deoplete#_context is needed instead of + " g:deoplete#_prev_completion + let prev_input = get(g:deoplete#_context, 'input', '') + if input ==# prev_input + \ && input !=# '' + \ && a:event !=# 'Manual' + \ && a:event !=# 'Async' + \ && a:event !=# 'Update' + \ && a:event !=# 'TextChangedP' + return 1 + endif + + return 0 +endfunction function! s:is_skip_text(event) abort let input = deoplete#util#get_input(a:event) |