diff --git a/UltiSnips/python.snippets b/UltiSnips/python.snippets index fbba1b0..b094759 100644 --- a/UltiSnips/python.snippets +++ b/UltiSnips/python.snippets @@ -6,6 +6,24 @@ if __name__ == '__main__': ${1:main()}$0 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 # ########## diff --git a/test.py b/test.py index 2e7caf7..fa2396d 100755 --- a/test.py +++ b/test.py @@ -20,6 +20,10 @@ JF = "?" # Jump forwards JB = "+" # Jump backwards EX = "\t" # EXPAND +# Some VIM functions +COMPL_KW = chr(24)+chr(14) +COMPL_ACCEPT = chr(25) + def send(s,session): os.system("screen -x %s -X stuff '%s'" % (session,s)) @@ -757,6 +761,17 @@ class ProperIndenting_AutoIndentAndNewline_ECR(_VimTest): self.send(":set noautoindent\n") _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 #