From d8cd3f3d0836c2a06f435b618959ff94055c8b05 Mon Sep 17 00:00:00 2001 From: Holger Rapp Date: Mon, 6 Jul 2009 11:47:27 +0200 Subject: [PATCH] Snippets are now dropped when cursor reached /bin/zsh --- PySnippets/tex.snippets | 4 ++++ plugin/PySnipEmu.py | 5 ++--- test.py | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/PySnippets/tex.snippets b/PySnippets/tex.snippets index 61cd04e..c6b9b73 100644 --- a/PySnippets/tex.snippets +++ b/PySnippets/tex.snippets @@ -10,6 +10,10 @@ ${0} % section $1 (end) endsnippet +snippet r "\ref{}" +\ref{$1} +endsnippet + ##################### # TEXTMATE SNIPPETS # ##################### diff --git a/plugin/PySnipEmu.py b/plugin/PySnipEmu.py index 8940902..0f2d694 100644 --- a/plugin/PySnipEmu.py +++ b/plugin/PySnipEmu.py @@ -548,8 +548,7 @@ class SnippetInstance(TextObject): def select_next_tab(self, backwards = False): if self._cts == 0: - if not backwards: - return False + return False if backwards: cts_bf = self._cts @@ -577,7 +576,7 @@ class SnippetInstance(TextObject): ts.select(self._start) self._tab_selected = True - return True + return self._cts def backspace(self,count, previous_cp): cts = self._tabstops[self._cts] diff --git a/test.py b/test.py index 700d9cc..471d6a0 100755 --- a/test.py +++ b/test.py @@ -179,11 +179,11 @@ class TestJumpingDontJumpToEndIfThereIsTabZero_ExceptCorrectResult(_VimTest): wanted = "hallo Hidu Test" class TabStopTestBackwardJumping_ExceptCorrectResult(_VimTest): - snippets = ("hallo", "hallo ${0:End} mitte${1:Beginning}") + snippets = ("hallo", "hallo ${2:End} mitte${1:Beginning}") keys = "hallo\tSomelengthy Text\tHi+Lets replace it again\tBlah\t++\t" wanted = "hallo Blah mitteLets replace it again" class TabStopTestBackwardJumping2_ExceptCorrectResult(_VimTest): - snippets = ("hallo", "hallo $0 $1") + snippets = ("hallo", "hallo $2 $1") keys = "hallo\tSomelengthy Text\tHi+Lets replace it again\tBlah\t++\t" wanted = "hallo Blah Lets replace it again"