fix b->b2<BS> case, fix merge

This commit is contained in:
Stanislav Seletskiy 2015-07-20 18:03:09 +06:00
parent 14ea90385b
commit 6c4fb6f3f2
2 changed files with 12 additions and 7 deletions

View File

@ -46,6 +46,12 @@ command! -bang -nargs=? -complete=customlist,UltiSnips#FileTypeComplete UltiSnip
command! -nargs=1 UltiSnipsAddFiletypes :call UltiSnips#AddFiletypes(<q-args>)
augroup UltiSnips_AutoTrigger
au!
au InsertCharPre * call UltiSnips#TrackChange()
au TextChangedI * call UltiSnips#TrackChange()
augroup END
call UltiSnips#map_keys#MapKeys()
" vim: ts=8 sts=4 sw=4

View File

@ -365,8 +365,6 @@ class SnippetManager(object):
_vim.command('autocmd!')
_vim.command('autocmd CursorMovedI * call UltiSnips#CursorMoved()')
_vim.command('autocmd CursorMoved * call UltiSnips#CursorMoved()')
_vim.command('autocmd InsertCharPre * call UltiSnips#TrackChange()')
_vim.command('autocmd TextChangedI * call UltiSnips#TrackChange()')
_vim.command(
'autocmd InsertLeave * call UltiSnips#LeavingInsertMode()')
@ -779,11 +777,12 @@ class SnippetManager(object):
@err_to_scratch_buffer
def _track_change(self):
inserted_char = _vim.eval('v:char')
if inserted_char == '':
before = _vim.buf.line_till_cursor
if before and before[-1] == self._last_inserted_char:
self._try_expand(autotrigger_only=True)
else:
try:
if inserted_char == '':
before = _vim.buf.line_till_cursor
if before and before[-1] == self._last_inserted_char:
self._try_expand(autotrigger_only=True)
finally:
self._last_inserted_char = inserted_char