Fixes #8 having errors with the double quotes when cpoptions is $

This commit is contained in:
jiangfriend@gmail.com 2012-03-13 21:33:00 +08:00
parent a452553602
commit 8026a0db4b

View File

@ -196,7 +196,8 @@ function! AutoPairsFastWrap()
endfunction
function! AutoPairsMap(key)
execute 'inoremap <buffer> <silent> '.a:key.' <C-R>=AutoPairsInsert("\'.a:key.'")<CR>'
let escaped_key = substitute(a:key, "'", "''", 'g')
execute 'inoremap <buffer> <silent> '.a:key." <C-R>=AutoPairsInsert('".escaped_key."')<CR>"
endfunction
function! AutoPairsToggle()