From ae8e1818efe27bb946fd948fc2fe8cc3f38e0e2d Mon Sep 17 00:00:00 2001 From: Jagua Date: Fri, 15 Mar 2019 01:31:25 +0900 Subject: Add more escape I believe that escape() is necessary at 3rd argument of substitute(). example: ```go "%v",&P{}.log ``` and type `` actual: ```go log.Println("%v",{{$1}}P{}) ``` expect: ```go log.Println("%v",&P{}) ``` --- autoload/sonictemplate.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'autoload') diff --git a/autoload/sonictemplate.vim b/autoload/sonictemplate.vim index 913d7d3..9397efa 100644 --- a/autoload/sonictemplate.vim +++ b/autoload/sonictemplate.vim @@ -340,7 +340,7 @@ function! sonictemplate#postfix() return '' endif let line = getline('.')[:col('.')] - let line = escape(line, '\') + let line = escape(line, '\&') for k in keys(s:pat[s:get_raw_filetype()]) let m = matchstr(line, k) if len(m) > 0 -- cgit v1.2.3-54-g00ecf