diff options
author | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2016-12-25 15:48:48 +0900 |
---|---|---|
committer | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2016-12-25 15:48:48 +0900 |
commit | c71c70f0b2674cfeab3fbcfa8d866ee37e17a73f (patch) | |
tree | e0667e48ac3953e35e2c1564bd9dd73698aca432 /autoload | |
parent | f94851be9b91c3c91291119de4fb44bc28042076 (diff) | |
download | deoplete.nvim-c71c70f0b2674cfeab3fbcfa8d866ee37e17a73f.zip |
Update tests
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/deoplete/handler.vim | 10 | ||||
-rw-r--r-- | autoload/deoplete/init.vim | 4 | ||||
-rw-r--r-- | autoload/deoplete/util.vim | 10 |
3 files changed, 12 insertions, 12 deletions
diff --git a/autoload/deoplete/handler.vim b/autoload/deoplete/handler.vim index 0435a4d..190b733 100644 --- a/autoload/deoplete/handler.vim +++ b/autoload/deoplete/handler.vim @@ -66,7 +66,7 @@ function! s:completion_begin(event) abort \ 'b:deoplete_omni_patterns', \ 'g:deoplete#omni_patterns', \ 'g:deoplete#_omni_patterns')) - if pattern != '' && &l:omnifunc != '' + if pattern !=# '' && &l:omnifunc !=# '' \ && context.input =~# '\%('.pattern.'\)$' call deoplete#mapping#_set_completeopt() call feedkeys("\<C-x>\<C-o>", 'n') @@ -92,7 +92,7 @@ function! s:is_skip(event, context) abort if &paste \ || mode() !=# 'i' \ || (a:event !=# 'Manual' && disable_auto_complete) - \ || (&l:completefunc != '' && &l:buftype =~# 'nofile') + \ || (&l:completefunc !=# '' && &l:buftype =~# 'nofile') \ || (a:event ==# 'InsertEnter' \ && has_key(g:deoplete#_context, 'position')) return 1 @@ -103,7 +103,7 @@ function! s:is_skip(event, context) abort let word = get(v:completed_item, 'word', '') let delimiters = filter(copy(g:deoplete#delimiters), \ 'strridx(word, v:val) == (len(word) - len(v:val))') - if word == '' || empty(delimiters) + if word ==# '' || empty(delimiters) return 1 endif endif @@ -127,7 +127,7 @@ function! s:is_skip_text(event) abort \ '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 @@ -145,7 +145,7 @@ function! s:on_insert_leave() abort endfunction function! s:complete_done() abort - if get(v:completed_item, 'word', '') != '' + if get(v:completed_item, 'word', '') !=# '' let word = v:completed_item.word if !has_key(g:deoplete#_rank, word) let g:deoplete#_rank[word] = 1 diff --git a/autoload/deoplete/init.vim b/autoload/deoplete/init.vim index 956c1b4..f331aae 100644 --- a/autoload/deoplete/init.vim +++ b/autoload/deoplete/init.vim @@ -154,10 +154,10 @@ endfunction function! deoplete#init#_context(event, sources) abort let filetype = (exists('*context_filetype#get_filetype') ? \ context_filetype#get_filetype() : - \ (&filetype == '' ? 'nothing' : &filetype)) + \ (&filetype ==# '' ? 'nothing' : &filetype)) let filetypes = exists('*context_filetype#get_filetypes') ? \ context_filetype#get_filetypes() : - \ &filetype == '' ? ['nothing'] : + \ &filetype ==# '' ? ['nothing'] : \ deoplete#util#uniq([&filetype] \ + split(&filetype, '\.')) let same_filetypes = exists('*context_filetype#get_same_filetypes') ? diff --git a/autoload/deoplete/util.vim b/autoload/deoplete/util.vim index a209363..eb3f389 100644 --- a/autoload/deoplete/util.vim +++ b/autoload/deoplete/util.vim @@ -66,7 +66,7 @@ function! deoplete#util#get_input(event) abort \ '^.*\%' . (mode ==# 'i' ? col('.') : col('.') - 1) \ . 'c' . (mode ==# 'i' ? '' : '.')) - if input =~ '^.\{-}\ze\S\+$' + if input =~# '^.\{-}\ze\S\+$' let complete_str = matchstr(input, '\S\+$') let input = matchstr(input, '^.\{-}\ze\S\+$') else @@ -96,14 +96,14 @@ function! s:vimoption2python(option) abort let has_dash = 0 let patterns = [] for pattern in split(a:option, ',') - if pattern == '' + if pattern ==# '' " , call add(patterns, ',') - elseif pattern == '\' + elseif pattern ==# '\' call add(patterns, '\\') - elseif pattern == '-' + elseif pattern ==# '-' let has_dash = 1 - elseif pattern =~ '\d\+' + elseif pattern =~# '\d\+' call add(patterns, substitute(pattern, '\d\+', \ '\=nr2char(submatch(0))', 'g')) else |