diff options
author | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2018-12-25 21:26:02 +0900 |
---|---|---|
committer | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2018-12-25 21:26:02 +0900 |
commit | f0878d71592931f433a4ef37f3a5f21c21951c6b (patch) | |
tree | 7d2308d4b07692a9016653885e44516f282fd7d2 | |
parent | 65e17f225852da5809b3fe6ce65f5a2d5ce2a74f (diff) | |
download | deoplete.nvim-f0878d71592931f433a4ef37f3a5f21c21951c6b.zip |
Add skip_multibyte option
-rw-r--r-- | autoload/deoplete/handler.vim | 8 | ||||
-rw-r--r-- | autoload/deoplete/init.vim | 1 | ||||
-rw-r--r-- | doc/deoplete.txt | 7 |
3 files changed, 15 insertions, 1 deletions
diff --git a/autoload/deoplete/handler.vim b/autoload/deoplete/handler.vim index 0c332a4..08b3386 100644 --- a/autoload/deoplete/handler.vim +++ b/autoload/deoplete/handler.vim @@ -193,9 +193,15 @@ function! s:is_skip(event) abort return 0 endfunction function! s:is_skip_text(event) abort - let context = g:deoplete#_context let input = deoplete#util#get_input(a:event) + let lastchar = matchstr(input, '.$') + let skip_multibyte = deoplete#custom#_get_option('skip_multibyte') + if skip_multibyte && len(lastchar) != strwidth(lastchar) + return 1 + endif + + let context = g:deoplete#_context if has_key(context, 'input') \ && a:event !=# 'Manual' \ && a:event !=# 'Async' diff --git a/autoload/deoplete/init.vim b/autoload/deoplete/init.vim index 53fdaef..3c5316b 100644 --- a/autoload/deoplete/init.vim +++ b/autoload/deoplete/init.vim @@ -220,6 +220,7 @@ function! deoplete#init#_option() abort \ 'min_pattern_length': 2, \ 'refresh_always': v:true, \ 'skip_chars': ['(', ')'], + \ 'skip_multibyte': v:false, \ 'smart_case': &smartcase, \ 'sources': {}, \ 'trigger_key': v:char, diff --git a/doc/deoplete.txt b/doc/deoplete.txt index ff9642c..cf8babf 100644 --- a/doc/deoplete.txt +++ b/doc/deoplete.txt @@ -243,6 +243,13 @@ refresh_always Default value: v:true + *deoplete-options-skip_multibyte* +skip_multibyte + Deoplete skip multibyte text completion automatically if this + value is True. + + Default value: v:false + *deoplete-options-skip_chars* skip_chars The list of skip characters in the auto completion. |