Skip to content

Commit

Permalink
Use ++nested for autocmd
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed May 27, 2024
1 parent 324defc commit 572fc33
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions autoload/ddc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ function ddc#enable_cmdline_completion() abort

augroup ddc-cmdline
autocmd!
autocmd CmdlineLeave * call ddc#hide('CmdlineLeave')
autocmd CmdlineEnter * call ddc#on_event('CmdlineEnter')
autocmd CmdlineChanged *
autocmd CmdlineLeave * ++nested call ddc#hide('CmdlineLeave')
autocmd CmdlineEnter * ++nested call ddc#on_event('CmdlineEnter')
autocmd CmdlineChanged * ++nested
\ : if getcmdtype() !=# '=' && getcmdtype() !=# '@'
\ | call ddc#on_event('CmdlineChanged')
\ | endif
autocmd ModeChanged c:n call s:disable_cmdline_completion()
autocmd ModeChanged c:n ++nested call s:disable_cmdline_completion()
augroup END

let b:ddc_cmdline_completion = v:true
Expand All @@ -35,7 +35,7 @@ function ddc#enable_terminal_completion() abort

augroup ddc-terminal
autocmd!
autocmd TextChangedT * call ddc#on_event('TextChangedT')
autocmd TextChangedT * ++nested call ddc#on_event('TextChangedT')
augroup END
endfunction

Expand Down
6 changes: 3 additions & 3 deletions autoload/ddc/denops.vim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function ddc#denops#_init(opts = {}) abort

augroup ddc
autocmd!
autocmd InsertLeave * call ddc#hide('InsertLeave')
autocmd InsertLeave * ++nested call ddc#hide('InsertLeave')
augroup END

let context_filetype = a:opts->get('context_filetype', 'none')
Expand All @@ -30,7 +30,7 @@ function ddc#denops#_init(opts = {}) abort
\ denops#server#status() ==# 'running')
call s:register()
else
autocmd ddc User DenopsReady call s:register()
autocmd ddc User DenopsReady ++nested call s:register()
endif
endfunction

Expand Down Expand Up @@ -73,7 +73,7 @@ function s:register() abort
\ 'ddc',
\ [s:root_dir, 'denops', 'ddc', 'app.ts']->join(s:sep))

autocmd ddc User DenopsClosed call s:stopped()
autocmd ddc User DenopsClosed ++nested call s:stopped()
endfunction

function s:stopped() abort
Expand Down
4 changes: 2 additions & 2 deletions autoload/ddc/map.vim
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ function ddc#map#insert_item(number) abort

" Call CompleteDone later.
if mode ==# 'i'
autocmd ddc TextChangedI * ++once
autocmd ddc TextChangedI * ++once ++nested
\ : doautocmd <nomodeline> CompleteDone
\ | if '#User#PumCompleteDonePre'->exists()
\ | doautocmd <nomodeline> User PumCompleteDonePre
\ | endif
elseif mode ==# 'c'
autocmd ddc CmdlineChanged * ++once
autocmd ddc CmdlineChanged * ++once ++nested
\ : if '#User#PumCompleteDonePre'->exists()
\ | doautocmd <nomodeline> User PumCompleteDonePre
\ | endif
Expand Down

0 comments on commit 572fc33

Please sign in to comment.