Fully implemented backspacing while tab is selected

This commit is contained in:
Holger Rapp 2009-07-06 18:34:12 +02:00
parent 8c8f3b9769
commit ee882dd769
3 changed files with 5 additions and 9 deletions

View File

@ -938,12 +938,11 @@ class SnippetManager(object):
self._current_snippets = []
def normal_mode_moved(self):
def backspace(self):
# BS was called in select mode
if len(self._current_snippets) and \
self._current_snippets[-1].tab_selected and \
self._vstate.buf_changed:
self._current_snippets[-1].tab_selected:
# This only happens when a default value is delted using backspace
vim.command(r'call feedkeys("i")')
cs = self._current_snippets[-1]

View File

@ -59,7 +59,7 @@ inoremap <Tab> <C-R>=PyVimSnips_ExpandSnippet()<cr>
snoremap <Tab> <Esc>:call PyVimSnips_ExpandSnippet()<cr>
inoremap <S-Tab> <C-R>=PyVimSnips_JumpBackwards()<cr>
snoremap <S-Tab> <Esc>:call PyVimSnips_JumpBackwards()<cr>
snoremap <BS> <Esc>:py PySnipSnippets.normal_mode_moved()<cr>
snoremap <BS> <Esc>:py PySnipSnippets.backspace()<cr>
au CursorMovedI * py PySnipSnippets.cursor_moved()
au InsertEnter * py PySnipSnippets.entered_insert_mode()

View File

@ -494,9 +494,6 @@ class Transformation_OptionReplaceGlobalMatchInReplace_ECR(_VimTest):
wanted = "a, nice, building a, nice, building"
# TODO: conditional in conditional, case folding recursive
# TODO: jumping out of snippet in insert mode
#
print "TODO: backspacing when tab is selected"
###################
# CURSOR MOVEMENT #