From 8026a0db4b0ac6dfc2be90b8cadef3cdd78055a3 Mon Sep 17 00:00:00 2001 From: "jiangfriend@gmail.com" Date: Tue, 13 Mar 2012 21:33:00 +0800 Subject: [PATCH] Fixes #8 having errors with the double quotes when cpoptions is $ --- plugin/auto-pairs.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/auto-pairs.vim b/plugin/auto-pairs.vim index 7e7a0df..95773e4 100644 --- a/plugin/auto-pairs.vim +++ b/plugin/auto-pairs.vim @@ -196,7 +196,8 @@ function! AutoPairsFastWrap() endfunction function! AutoPairsMap(key) - execute 'inoremap '.a:key.' =AutoPairsInsert("\'.a:key.'")' + let escaped_key = substitute(a:key, "'", "''", 'g') + execute 'inoremap '.a:key." =AutoPairsInsert('".escaped_key."')" endfunction function! AutoPairsToggle()