summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShougo Matsushita <Shougo.Matsu@gmail.com>2016-12-09 06:22:18 +0900
committerShougo Matsushita <Shougo.Matsu@gmail.com>2016-12-09 06:22:18 +0900
commit6adaaa380ff1327d8e55fa2b9d315bd9f33cf7a9 (patch)
treecf29ab1ff3f966f8efd4ec12612a8a5ac2238d78
parent2211f12e1dad2f453a3cf6a78ddb6d7d5162d569 (diff)
downloaddeoplete.nvim-6adaaa380ff1327d8e55fa2b9d315bd9f33cf7a9.zip
Add g:deoplete#skip_chars
-rw-r--r--autoload/deoplete/handler.vim6
-rw-r--r--autoload/deoplete/init.vim2
-rw-r--r--doc/deoplete.txt10
3 files changed, 17 insertions, 1 deletions
diff --git a/autoload/deoplete/handler.vim b/autoload/deoplete/handler.vim
index 402e235..a73ef87 100644
--- a/autoload/deoplete/handler.vim
+++ b/autoload/deoplete/handler.vim
@@ -123,8 +123,12 @@ function! s:is_skip_text(event) abort "{{{
endif
endif
+ let skip_chars = deoplete#util#get_simple_buffer_config(
+ \ 'b:deoplete_skip_chars', 'g:deoplete#skip_chars')
+
return (!pumvisible() && virtcol('.') != displaywidth)
- \ || (a:event !=# 'Manual' && input =~ '[})>\]]$')
+ \ || (a:event !=# 'Manual' && input != ''
+ \ && index(skip_chars, input[-1:]) >= 0)
endfunction"}}}
function! s:on_event(event) abort "{{{
diff --git a/autoload/deoplete/init.vim b/autoload/deoplete/init.vim
index fe84f23..062d5f0 100644
--- a/autoload/deoplete/init.vim
+++ b/autoload/deoplete/init.vim
@@ -112,6 +112,8 @@ function! deoplete#init#_variables() abort "{{{
\ 'g:deoplete#max_abbr_width', 80)
call deoplete#util#set_default(
\ 'g:deoplete#max_menu_width', 40)
+ call deoplete#util#set_default(
+ \ 'g:deoplete#skip_chars', [])
call deoplete#util#set_default(
\ 'g:deoplete#keyword_patterns', {})
diff --git a/doc/deoplete.txt b/doc/deoplete.txt
index 51fd759..86c548a 100644
--- a/doc/deoplete.txt
+++ b/doc/deoplete.txt
@@ -195,6 +195,16 @@ g:deoplete#auto_refresh_delay
Default value: 50
+ *g:deoplete#skip_chars*
+g:deoplete#skip_chars
+ The list of skip characters in the auto completion.
+
+ Default value: []
+
+ *b:deoplete_skip_chars*
+b:deoplete_skip_chars
+ Buffer local variable of |g:deoplete#skip_chars|.
+
*g:deoplete#keyword_patterns*
g:deoplete#keyword_patterns
This dictionary records keyword patterns to buffer completion.