Skip to content

Ensure events are (or aren't) being ignored correctly. #1080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 16, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Put the eventignore reset inside a finally block to ensure it's called.
  • Loading branch information
Phil Runninger committed Jan 16, 2020
commit 5fbf0d7dba2ec12af6d0ca145a1cc2e87663c702
7 changes: 5 additions & 2 deletions autoload/nerdtree.vim
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,11 @@ function! nerdtree#exec(cmd, ignoreAll) abort
if a:ignoreAll
set eventignore=all
endif
exec a:cmd
let &eventignore = old_ei
try
exec a:cmd
finally
let &eventignore = old_ei
endtry
endfunction

" FUNCTION: nerdtree#has_opt(options, name) {{{2
Expand Down
17 changes: 10 additions & 7 deletions lib/nerdtree/creator.vim
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,17 @@ function! s:Creator._tabpagevar(tabnr, var)
let old_ei = &eventignore
set eventignore=all

exec 'tabnext ' . a:tabnr
let v = -1
if exists('t:' . a:var)
exec 'let v = t:' . a:var
endif
exec 'tabnext ' . currentTab
try
exec 'tabnext ' . a:tabnr
let v = -1
if exists('t:' . a:var)
exec 'let v = t:' . a:var
endif
exec 'tabnext ' . currentTab

let &eventignore = old_ei
finally
let &eventignore = old_ei
endtry

return v
endfunction
Expand Down