Skip to content

Commit

Permalink
Fix for E497 error
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Jun 12, 2024
1 parent 0c74f86 commit e4ce38a
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions autoload/dpp/denops.vim
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,24 @@ function s:init() abort

let g:dpp#_started = reltime()

" NOTE: dpp.vim must be registered manually.
if 'g:loaded_denops'->exists() &&
\ ('<amatch>'->expand() ==# 'DenopsReady' ||
\ denops#server#status() ==# 'running')
call s:register()
else
autocmd dpp User DenopsReady ++nested call s:register()
" NOTE: denops load may be started
if 'g:loaded_denops'->exists()
if denops#server#status() ==# 'running'
call s:register()
return
endif

try
if '<amatch>'->expand() ==# 'DenopsReady'
call s:register()
return
endif
catch /^Vim\%((\a\+)\)\=:E497:/
" NOTE: E497 is occured when it is not in autocmd.
endtry
endif

autocmd dpp User DenopsReady ++nested call s:register()
endfunction

function s:notify(method, args) abort
Expand Down

0 comments on commit e4ce38a

Please sign in to comment.