Added box snippets for python. Added a test case for completion inside of snippets
This commit is contained in:
parent
717ae7586c
commit
7a34de5613
@ -6,6 +6,24 @@ if __name__ == '__main__':
|
|||||||
${1:main()}$0
|
${1:main()}$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
##############
|
||||||
|
# NICE BOXES #
|
||||||
|
##############
|
||||||
|
snippet box
|
||||||
|
`!p res = (len(t[1])+4)*"#"`
|
||||||
|
# ${1:content} #
|
||||||
|
`!p res = (len(t[1])+4)*"#"`
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet bbox
|
||||||
|
`!p res = 75*"#"`
|
||||||
|
# `!p res = (71-len(t[1]))/2*' '`${1:content}`!p a = 71-len(t[1]); res = (a/2 + a%2) * " " ` #
|
||||||
|
`!p res = 75*"#"`
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
|
||||||
##########
|
##########
|
||||||
# COMMON #
|
# COMMON #
|
||||||
##########
|
##########
|
||||||
|
15
test.py
15
test.py
@ -20,6 +20,10 @@ JF = "?" # Jump forwards
|
|||||||
JB = "+" # Jump backwards
|
JB = "+" # Jump backwards
|
||||||
EX = "\t" # EXPAND
|
EX = "\t" # EXPAND
|
||||||
|
|
||||||
|
# Some VIM functions
|
||||||
|
COMPL_KW = chr(24)+chr(14)
|
||||||
|
COMPL_ACCEPT = chr(25)
|
||||||
|
|
||||||
def send(s,session):
|
def send(s,session):
|
||||||
os.system("screen -x %s -X stuff '%s'" % (session,s))
|
os.system("screen -x %s -X stuff '%s'" % (session,s))
|
||||||
|
|
||||||
@ -757,6 +761,17 @@ class ProperIndenting_AutoIndentAndNewline_ECR(_VimTest):
|
|||||||
self.send(":set noautoindent\n")
|
self.send(":set noautoindent\n")
|
||||||
_VimTest.tearDown(self)
|
_VimTest.tearDown(self)
|
||||||
|
|
||||||
|
####################
|
||||||
|
# COMPLETION TESTS #
|
||||||
|
####################
|
||||||
|
class Completion_SimpleExample_ECR(_VimTest):
|
||||||
|
snippets = ("test", "$1 ${1:blah}")
|
||||||
|
keys = "superkallifragilistik\ntest" + EX + "sup" + COMPL_KW + \
|
||||||
|
COMPL_ACCEPT + " some more"
|
||||||
|
wanted = "superkallifragilistik\nsuperkallifragilistik some more " \
|
||||||
|
"superkallifragilistik some more"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
######################
|
######################
|
||||||
# SELECTING MULTIPLE #
|
# SELECTING MULTIPLE #
|
||||||
|
Loading…
Reference in New Issue
Block a user