Fix a bug in retaining the unnamed register.

This commit is contained in:
Holger Rapp 2014-02-10 21:06:04 +01:00
parent da1ff4087b
commit 888ce5dac5
2 changed files with 7 additions and 3 deletions

View File

@ -457,7 +457,7 @@ class SnippetManager(object):
if self._unnamed_reg_cached:
escaped_cache = self._unnamed_reg_cache.replace("'", "''")
_vim.command("let @\"='%s'" % escaped_cache)
self._unnamed_register_cached = False
self._unnamed_reg_cached = False
def _handle_failure(self, trigger):
"""Mainly make sure that we play well with SuperTab."""

View File

@ -2687,7 +2687,7 @@ class LeaveTrailingWhitespace(_VimTest):
snippets = ("test", """Hello \t ${1:default}\n$2""")
wanted = """Hello \t \nGoodbye"""
keys = "test" + EX + BS + JF + "Goodbye"
# End: Trailing whitespace }}}#
# End: Trailing whitespace #}}}
# Cursor Movement {{{#
class CursorMovement_Multiline_ECR(_VimTest):
@ -3043,11 +3043,15 @@ class Bug1251994(_VimTest):
wanted = " world hello;blub"
# End: 1251994 #}}}
# Test for Github Pull Request #134 {{{#
# Test for Github Pull Request #134 - Retain unnamed register {{{#
class RetainsTheUnnamedRegister(_VimTest):
snippets = ("test", "${1:hello} ${2:world} ${0}")
keys = "yank" + ESC + "by4lea test" + EX + "HELLO" + JF + JF + ESC + "p"
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 #}}}
class VerifyVimDict1(_VimTest):