Added tests for leaving snippets above or below
This commit is contained in:
parent
d8cd3f3d08
commit
02684225a8
@ -1 +1,44 @@
|
|||||||
# This is a comment, don't read it
|
# This is a comment, don't read it
|
||||||
|
|
||||||
|
snippet mfg
|
||||||
|
Mit freundlichen Grüßen,
|
||||||
|
Holger Rapp
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet lg
|
||||||
|
Liebe Grüße,
|
||||||
|
Holger
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet vg
|
||||||
|
Viele Grüße,
|
||||||
|
Holger
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet sig
|
||||||
|
----------------------------------------
|
||||||
|
Dipl.-Phys. Holger Rapp
|
||||||
|
|
||||||
|
Institut für Mess- und Regelungstechnik
|
||||||
|
Universität Karlsruhe (TH)
|
||||||
|
Engler-Bunte-Ring 21
|
||||||
|
76131 Karlsruhe, Germany
|
||||||
|
Geb. 40.32, Zi. 232, zweite Etage
|
||||||
|
|
||||||
|
Tel: +49 (0)721 / 608-2341
|
||||||
|
Fax: +49 (0)721 / 661874
|
||||||
|
Mail: Rapp@mrt.uka.de
|
||||||
|
Web: www.mrt.uni-karlsruhe.de
|
||||||
|
----------------------------------------
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet snip
|
||||||
|
------------------- SNIP -------------------
|
||||||
|
$0
|
||||||
|
------------------- SNAP -------------------
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
@ -890,8 +890,6 @@ class SnippetManager(object):
|
|||||||
if not is_inside:
|
if not is_inside:
|
||||||
self._current_snippets.pop()
|
self._current_snippets.pop()
|
||||||
|
|
||||||
# TODO: check if we left the current snippet
|
|
||||||
|
|
||||||
if not self._accept_input:
|
if not self._accept_input:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
11
test.py
11
test.py
@ -509,9 +509,14 @@ class IMMoving_ExitWhenOutsideLeft_ECR(_VimTest):
|
|||||||
snippets = ("test", r"${1:Hi} ${2:blub}")
|
snippets = ("test", r"${1:Hi} ${2:blub}")
|
||||||
keys = "hello test this" + ESC + "02f i\ttab" + 4*ARR_L + "\thallo"
|
keys = "hello test this" + ESC + "02f i\ttab" + 4*ARR_L + "\thallo"
|
||||||
wanted = "hellohallo tab blub this"
|
wanted = "hellohallo tab blub this"
|
||||||
|
class IMMoving_ExitWhenOutsideAbove_ECR(_VimTest):
|
||||||
# TODO: exit when below or above snippet
|
snippets = ("test", "${1:Hi}\n${2:blub}")
|
||||||
# TODO: single line snippet insertions always adds newline
|
keys = "hello test this" + ESC + "02f i\ttab" + 1*ARR_U + "\t\nhallo"
|
||||||
|
wanted = "hallo\nhello tab\nblub this"
|
||||||
|
class IMMoving_ExitWhenOutsideBelow_ECR(_VimTest):
|
||||||
|
snippets = ("test", "${1:Hi}\n${2:blub}")
|
||||||
|
keys = "hello test this" + ESC + "02f i\ttab" + 2*ARR_D + "\ttesthallo\n"
|
||||||
|
wanted = "hello tab\nblub this\ntesthallo"
|
||||||
|
|
||||||
####################
|
####################
|
||||||
# PROPER INDENTING #
|
# PROPER INDENTING #
|
||||||
|
Loading…
x
Reference in New Issue
Block a user