From db8a596b826a76e5731c7b30c8c97c92a84dad4c Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Fri, 1 Jul 2016 19:07:59 +0900 Subject: fix pattern --- autoload/sonictemplate.vim | 1 - template/javascript/pattern.tpl | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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\" 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_}} + } + -- cgit v1.2.3-54-g00ecf