From: Shawn M Moore Date: Tue, 5 May 2009 17:13:38 +0000 (-0400) Subject: Remove the empty line in "has" and "hasl" if you just tab out X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a55ef8276f4969ab07641f8cb569bf863b2c4786;p=gitmo%2Fmoose-dev-utils.git Remove the empty line in "has" and "hasl" if you just tab out --- diff --git a/vim/moose_snippets.vim b/vim/moose_snippets.vim index a8c2f69..4f9a8c1 100644 --- a/vim/moose_snippets.vim +++ b/vim/moose_snippets.vim @@ -10,6 +10,11 @@ function RemoveEmptySuperClass() return @z endfun +function RemoveEmptyLine() + s/^\s*<{}>\s*\n//e + return @z +endfun + function Snippet(abbr, str) if type(a:str) == type([]) return Snippet(a:abbr, join(a:str, "\n")) @@ -45,14 +50,14 @@ call Snippet('has', [ \"has <{attr}> => (", \ "is => '<{rw}>',", \ "isa => '<{Str}>',", - \ "<{}>", + \ "<{options:RemoveEmptyLine()}>", \");"]) call Snippet('hasl', [ \"has <{attr}> => (", \ "is => '<{rw}>',", \ "isa => '<{Str}>',", \ "lazy_build => 1,", - \ "<{}>", + \ "<{options:RemoveEmptyLine()}>", \");", \"", \"sub _build_<{attr}> {",