Fix a bug in retaining the unnamed register.
This commit is contained in:
parent
da1ff4087b
commit
888ce5dac5
@ -457,7 +457,7 @@ class SnippetManager(object):
|
|||||||
if self._unnamed_reg_cached:
|
if self._unnamed_reg_cached:
|
||||||
escaped_cache = self._unnamed_reg_cache.replace("'", "''")
|
escaped_cache = self._unnamed_reg_cache.replace("'", "''")
|
||||||
_vim.command("let @\"='%s'" % escaped_cache)
|
_vim.command("let @\"='%s'" % escaped_cache)
|
||||||
self._unnamed_register_cached = False
|
self._unnamed_reg_cached = False
|
||||||
|
|
||||||
def _handle_failure(self, trigger):
|
def _handle_failure(self, trigger):
|
||||||
"""Mainly make sure that we play well with SuperTab."""
|
"""Mainly make sure that we play well with SuperTab."""
|
||||||
|
8
test.py
8
test.py
@ -2687,7 +2687,7 @@ class LeaveTrailingWhitespace(_VimTest):
|
|||||||
snippets = ("test", """Hello \t ${1:default}\n$2""")
|
snippets = ("test", """Hello \t ${1:default}\n$2""")
|
||||||
wanted = """Hello \t \nGoodbye"""
|
wanted = """Hello \t \nGoodbye"""
|
||||||
keys = "test" + EX + BS + JF + "Goodbye"
|
keys = "test" + EX + BS + JF + "Goodbye"
|
||||||
# End: Trailing whitespace }}}#
|
# End: Trailing whitespace #}}}
|
||||||
|
|
||||||
# Cursor Movement {{{#
|
# Cursor Movement {{{#
|
||||||
class CursorMovement_Multiline_ECR(_VimTest):
|
class CursorMovement_Multiline_ECR(_VimTest):
|
||||||
@ -3043,11 +3043,15 @@ class Bug1251994(_VimTest):
|
|||||||
wanted = " world hello;blub"
|
wanted = " world hello;blub"
|
||||||
# End: 1251994 #}}}
|
# End: 1251994 #}}}
|
||||||
|
|
||||||
# Test for Github Pull Request #134 {{{#
|
# Test for Github Pull Request #134 - Retain unnamed register {{{#
|
||||||
class RetainsTheUnnamedRegister(_VimTest):
|
class RetainsTheUnnamedRegister(_VimTest):
|
||||||
snippets = ("test", "${1:hello} ${2:world} ${0}")
|
snippets = ("test", "${1:hello} ${2:world} ${0}")
|
||||||
keys = "yank" + ESC + "by4lea test" + EX + "HELLO" + JF + JF + ESC + "p"
|
keys = "yank" + ESC + "by4lea test" + EX + "HELLO" + JF + JF + ESC + "p"
|
||||||
wanted = "yank HELLO world yank"
|
wanted = "yank HELLO world yank"
|
||||||
|
class RetainsTheUnnamedRegister_ButOnlyOnce(_VimTest):
|
||||||
|
snippets = ("test", "${1:hello} ${2:world} ${0}")
|
||||||
|
keys = "blahfasel" + ESC + "v" + 4*ARR_L + "xotest" + EX + ESC + ARR_U + "v0xo" + ESC + "p"
|
||||||
|
wanted = "\nblah\nhello world "
|
||||||
# End: Github Pull Request # 134 #}}}
|
# End: Github Pull Request # 134 #}}}
|
||||||
|
|
||||||
class VerifyVimDict1(_VimTest):
|
class VerifyVimDict1(_VimTest):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user