From 3eabbe71a361e006509a250e6a79353a3f5a5521 Mon Sep 17 00:00:00 2001 From: Greg Hurrell Date: Thu, 6 Aug 2015 22:47:29 -0700 Subject: [PATCH] Use when firing user autocmds As recommended by the Vim help (`:h `): After applying the autocommands the modelines are processed, so that their settings overrule the settings from autocommands, like what happens when editing a file. This is skipped when the argument is present. You probably want to use for events that are not used when loading a buffer, such as |User|. Fixes: https://github.com/SirVer/ultisnips/issues/542 --- pythonx/UltiSnips/snippet_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pythonx/UltiSnips/snippet_manager.py b/pythonx/UltiSnips/snippet_manager.py index f144fbf..f84c48f 100644 --- a/pythonx/UltiSnips/snippet_manager.py +++ b/pythonx/UltiSnips/snippet_manager.py @@ -374,7 +374,7 @@ class SnippetManager(object): 'autocmd CmdwinLeave * call UltiSnips#LeavingBuffer()') _vim.command('augroup END') - _vim.command('silent doautocmd User UltiSnipsEnterFirstSnippet') + _vim.command('silent doautocmd User UltiSnipsEnterFirstSnippet') self._inner_state_up = True def _teardown_inner_state(self): @@ -382,7 +382,7 @@ class SnippetManager(object): if not self._inner_state_up: return try: - _vim.command('silent doautocmd User UltiSnipsExitLastSnippet') + _vim.command('silent doautocmd User UltiSnipsExitLastSnippet') if self.expand_trigger != self.forward_trigger: _vim.command('iunmap %s' % self.forward_trigger) _vim.command('sunmap %s' % self.forward_trigger)