fixes #33: character '|' map failed.
This commit is contained in:
parent
23e77decb1
commit
f6a18ca775
@ -273,9 +273,14 @@ function! AutoPairsFastWrap()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! AutoPairsMap(key)
|
function! AutoPairsMap(key)
|
||||||
let escaped_key = substitute(a:key, "'", "''", 'g')
|
" | is special key which separate map command from text
|
||||||
|
let key = a:key
|
||||||
|
if key == '|'
|
||||||
|
let key = '<BAR>'
|
||||||
|
end
|
||||||
|
let escaped_key = substitute(key, "'", "''", 'g')
|
||||||
" use expr will cause search() doesn't work
|
" use expr will cause search() doesn't work
|
||||||
execute 'inoremap <buffer> <silent> '.a:key." <C-R>=AutoPairsInsert('".escaped_key."')<CR>"
|
execute 'inoremap <buffer> <silent> '.key." <C-R>=AutoPairsInsert('".escaped_key."')<CR>"
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! AutoPairsToggle()
|
function! AutoPairsToggle()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user