aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--autoload/sonictemplate.vim1
-rw-r--r--template/javascript/pattern.tpl5
2 files changed, 5 insertions, 1 deletions
diff --git a/autoload/sonictemplate.vim b/autoload/sonictemplate.vim
index 2db9d77..72e5104 100644
--- a/autoload/sonictemplate.vim
+++ b/autoload/sonictemplate.vim
@@ -338,7 +338,6 @@ function! sonictemplate#pattern()
let lhs = lhs[len(indent):]
let c = lhs . c . rhs
endif
- let c = join(split(c, "\n"), "")
call setline('.', line)
silent! exe "normal! a\<c-r>=c\<cr>"
if stridx(c, '{{_cursor_}}') != -1
diff --git a/template/javascript/pattern.tpl b/template/javascript/pattern.tpl
index 0102f15..1ef204a 100644
--- a/template/javascript/pattern.tpl
+++ b/template/javascript/pattern.tpl
@@ -4,3 +4,8 @@
^\s*\zs\(\S.*\)\.throw$
throw {{$1}};
+\(\S\+\)\.notif$
+ if ({{$1}} != null) {
+ {{_cursor_}}
+ }
+