Fully implemented backspacing while tab is selected
This commit is contained in:
parent
8c8f3b9769
commit
ee882dd769
@ -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]
|
||||
|
@ -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()
|
||||
|
3
test.py
3
test.py
@ -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 #
|
||||
|
Loading…
Reference in New Issue
Block a user