aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJagua <jagualitol@gmail.com>2019-03-07 00:41:39 +0900
committerJagua <jagualitol@gmail.com>2019-03-07 00:41:39 +0900
commitb597d858785e933b00e1abc0f004be58cab24520 (patch)
tree97ac3e72a5dab188b38106b040ab478c43105d44
parentffd98639c3a2444d84585397e42a985371a90358 (diff)
downloadvim-sonictemplate-b597d858785e933b00e1abc0f004be58cab24520.tar.gz
vim-sonictemplate-b597d858785e933b00e1abc0f004be58cab24520.tar.bz2
vim-sonictemplate-b597d858785e933b00e1abc0f004be58cab24520.zip
Fix missing backslash escape
When writing in Go, type the following code, ```go "AA\nBB".log ``` and hits `<C-y><C-b>`, then got the following result. ```go log.Println("AA BB") ``` but want this. ```go log.Println("AA\nBB") ```
-rw-r--r--autoload/sonictemplate.vim1
1 files changed, 1 insertions, 0 deletions
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