=== modified file 'plugin/UltiSnips/__init__.py' --- plugin/UltiSnips/__init__.py 2009-08-16 18:55:08 +0000 +++ plugin/UltiSnips/__init__.py 2009-08-24 10:28:54 +0000 @@ -500,7 +500,11 @@ """ Mainly make sure that we play well with SuperTab """ - feedkey = None + if trigger.lower() == "": + feedkey = "\\" + trigger + else: + feedkey = None + mode = "n" if not self._supertab_keys: if vim.eval("exists('g:SuperTabMappingForward')") != "0": self._supertab_keys = ( @@ -516,10 +520,12 @@ feedkey= r"\" elif idx == 1: feedkey = r"\" + # Use remap mode so SuperTab mappings will be invoked. + mode = "m" break if feedkey: - vim.command(r'call feedkeys("%s")' % feedkey) + vim.command(r'call feedkeys("%s", "%s")' % (feedkey, mode)) def _ensure_snippets_loaded(self): filetypes = vim.eval("&filetype").split(".") + [ "all" ] === modified file 'test.py' --- test.py 2009-08-17 15:33:28 +0000 +++ test.py 2009-08-24 10:28:54 +0000 @@ -54,6 +54,9 @@ def check_output(self): wanted = self.text_before + '\n\n' + self.wanted + \ '\n\n' + self.text_after + for i in range(2): + if self.output != wanted: + self.setUp() self.assertEqual(self.output, wanted) def runTest(self): self.check_output() @@ -161,7 +164,7 @@ class DoNotExpandAfterSpace_ExceptCorrectResult(_SimpleExpands): keys = "hallo " + EX - wanted = "hallo " + wanted = "hallo " + EX class ExpandInTheMiddleOfLine_ExceptCorrectResult(_SimpleExpands): keys = "Wie hallo gehts" + ESC + "bhi" + EX @@ -1061,7 +1064,7 @@ class SnippetOptions_OnlyExpandWhenWSInFront_DontExpand(_VimTest): snippets = ("test", "Expand me!", "", "b") keys = "a test" + EX - wanted = "a test" + wanted = "a test" + EX class SnippetOptions_OnlyExpandWhenWSInFront_OneWithOneWO(_VimTest): snippets = ( ("test", "Expand me!", "", "b"),