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 0ef1674 commit 9706f47
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions autoload/ddu/denops.vim
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,21 @@ function s:init() abort
" NOTE: ddu.vim must be registered manually.

" NOTE: denops load may be started
if 'g:loaded_denops'->exists() &&
\ ('<amatch>'->expand() ==# 'DenopsReady' ||
\ denops#server#status() ==# 'running')
call s:register()
else
autocmd ddu User DenopsReady ++nested call s:register()
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 ddu User DenopsReady ++nested call s:register()
endfunction

0 comments on commit 9706f47

Please sign in to comment.