From b597d858785e933b00e1abc0f004be58cab24520 Mon Sep 17 00:00:00 2001 From: Jagua Date: Thu, 7 Mar 2019 00:41:39 +0900 Subject: Fix missing backslash escape When writing in Go, type the following code, ```go "AA\nBB".log ``` and hits ``, then got the following result. ```go log.Println("AA BB") ``` but want this. ```go log.Println("AA\nBB") ``` --- autoload/sonictemplate.vim | 1 + 1 file changed, 1 insertion(+) (limited to 'autoload') diff --git a/autoload/sonictemplate.vim b/autoload/sonictemplate.vim index 2c68664..b1ff6a9 100644 --- a/autoload/sonictemplate.vim +++ b/autoload/sonictemplate.vim @@ -336,6 +336,7 @@ function! sonictemplate#postfix() return '' endif let line = getline('.')[:col('.')] + let line = escape(line, '\') for k in keys(s:pat[&ft]) let m = matchstr(line, k) if len(m) > 0 -- cgit v1.2.3-54-g00ecf