Fixed a inconsequent handling of indent: indent was different for recursive snippets then for the othermost snippet

This commit is contained in:
Holger Rapp 2009-07-17 23:42:33 +02:00
parent 93b3cc7126
commit 5d2a39a0c5
2 changed files with 6 additions and 1 deletions

View File

@ -263,7 +263,8 @@ class SnippetManager(object):
start = Position(end.line, end.col - len(snippet.trigger))
# TODO: very much the same as above
indent = vim.current.line[:pos.col - len(snippet.trigger)]
text_before = vim.current.line[:pos.col - len(snippet.trigger)]
indent = snippet._INDENT.match(text_before).group(0)
v = snippet.value
if indent.strip(" \n") == "":
lines = v.splitlines()

View File

@ -532,6 +532,10 @@ class RecTabStops_InNewlineManualIndent_ECR(_VimTest):
snippets = ("m", "M START\n$0\nM END")
keys = "m" + EX + " m" + EX + "hi"
wanted = "M START\n M START\n hi\n M END\nM END"
class RecTabStops_InNewlineManualIndentTextInFront_ECR(_VimTest):
snippets = ("m", "M START\n$0\nM END")
keys = "m" + EX + " hallo m" + EX + "hi"
wanted = "M START\n hallo M START\n hi\n M END\nM END"
class RecTabStops_InNewlineMultilineWithIndent_ECR(_VimTest):
snippets = ("m", "M START\n $0\nM END")
keys = "m" + EX + "m" + EX + "hi"