Skip to content

Commit

Permalink
Merge pull request Shougo#249 from tyru/exists-equals-to-2
Browse files Browse the repository at this point in the history
Check if `exists(':cmdname')` == 2
  • Loading branch information
Shougo committed Jan 22, 2018
2 parents 2adba76 + 968c276 commit e5fe114
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions autoload/dein/autoload.vim
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ endfunction
function! dein#autoload#_on_cmd(command, name, args, bang, line1, line2) abort
call dein#source(a:name)

if !exists(':' . a:command)
if exists(':' . a:command) != 2
call dein#util#_error(printf('command %s is not found.', a:command))
return
endif
Expand Down Expand Up @@ -215,15 +215,15 @@ endfunction

function! dein#autoload#_dummy_complete(arglead, cmdline, cursorpos) abort
let command = matchstr(a:cmdline, '\h\w*')
if exists(':'.command)
if exists(':'.command) == 2
" Remove the dummy command.
silent! execute 'delcommand' command
endif

" Load plugins
call dein#autoload#_on_pre_cmd(tolower(command))

if exists(':'.command)
if exists(':'.command) == 2
" Print the candidates
call feedkeys("\<C-d>", 'n')
endif
Expand Down
2 changes: 1 addition & 1 deletion autoload/dein/install.vim
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ function! dein#install#_remote_plugins() abort
let &runtimepath = dein#util#_join_rtp(dein#util#_uniq(
\ dein#util#_split_rtp(&runtimepath)), &runtimepath, '')

if exists(':UpdateRemotePlugins')
if exists(':UpdateRemotePlugins') == 2
UpdateRemotePlugins
endif
endfunction
Expand Down

0 comments on commit e5fe114

Please sign in to comment.