endif
endfun
+function! RemoveUnchangedLineSemicolon()
+ if match(getline('.'), "<{}>") >= 0
+ normal! ddkA;
+ normal! o
+ return ''
+ else
+ normal! A;
+ "normal! o " we can't actually change what line we're on :/
+ return @z
+ endif
+endfun
+
function! Snippet(abbr, str)
if type(a:str) == type([])
return Snippet(a:abbr, join(a:str, "\n"))
\ "my $self = shift;",
\ "<{}>",
\"};"])
+call Snippet('subtype', [
+ \"subtype '<{name}>'",
+ \ "=> as '<{supertype}>'",
+ \ "=> where { <{predicate:RemoveUnchangedLine()}> }",
+ \ "=> message { \"<{message:RemoveUnchangedLineSemicolon()}>\" }",
+ \""])
" MooseX support
call Snippet('prole', [