Suppress autocmds less aggressively #61
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed that my statusline doesn't update properly when using undotree to move between revisions of a file (wincent/wincent#16). I established that this was because it was using
'eventignore'
to suppress all autocmds, which in turn prevents the statusline from updating.Commenting out the
set eventignore=all
line makes the failure to update go away, at the cost of firing more autocmds.I considered adding an option for opting out of this behavior (eg.
let g:Undotree_Eventignore=0
or something), or rearchitecting my statusline to use an approach like vim-airline does based on CursorMoved autocmds (see vim-airline/vim-airline#82; see also https://github.com/vim-airline/vim-airline/blob/30f078daf569e7d5e4f7829e39316387af349b41/plugin/airline.vim#L36-L50 for current implementation), but then realized that a simpler fix is to have undotree just disable only the autocmds that it uses instead of disabling all of them.This is probably not enough to unbreak every bit of code in the world that depends on those autocmds, but it does at least unbreak my use case, because it allows my
WinLeave
autocmd to run and update the statusline.