Prioritize local mappings over global ones (#1049)

If the user has a global mapping which begins like a local one,
they probably expect the local mapping to win.
Without `<nowait>`, they would have to wait for the timeout to occur.
This commit is contained in:
lacygoill 2019-05-05 07:05:11 +02:00 committed by Holger Rapp
parent 0165e50d0d
commit 0fdf2ece4f

View File

@ -345,13 +345,13 @@ class SnippetManager(object):
if self._inner_state_up: if self._inner_state_up:
return return
if self.expand_trigger != self.forward_trigger: if self.expand_trigger != self.forward_trigger:
_vim.command('inoremap <buffer> <silent> ' + self.forward_trigger + _vim.command('inoremap <buffer><nowait><silent> ' + self.forward_trigger +
' <C-R>=UltiSnips#JumpForwards()<cr>') ' <C-R>=UltiSnips#JumpForwards()<cr>')
_vim.command('snoremap <buffer> <silent> ' + self.forward_trigger + _vim.command('snoremap <buffer><nowait><silent> ' + self.forward_trigger +
' <Esc>:call UltiSnips#JumpForwards()<cr>') ' <Esc>:call UltiSnips#JumpForwards()<cr>')
_vim.command('inoremap <buffer> <silent> ' + self.backward_trigger + _vim.command('inoremap <buffer><nowait><silent> ' + self.backward_trigger +
' <C-R>=UltiSnips#JumpBackwards()<cr>') ' <C-R>=UltiSnips#JumpBackwards()<cr>')
_vim.command('snoremap <buffer> <silent> ' + self.backward_trigger + _vim.command('snoremap <buffer><nowait><silent> ' + self.backward_trigger +
' <Esc>:call UltiSnips#JumpBackwards()<cr>') ' <Esc>:call UltiSnips#JumpBackwards()<cr>')
# Setup the autogroups. # Setup the autogroups.