Permalink
Browse files

fixes #33: character '|' map failed.

  • Loading branch information...
1 parent 23e77de commit f6a18ca775d676109f0fd2e0678710badd5e7f85 @jiangmiao committed Feb 18, 2013
Showing with 7 additions and 2 deletions.
  1. +7 −2 plugin/auto-pairs.vim
View
@@ -273,9 +273,14 @@ function! AutoPairsFastWrap()
endfunction
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
- execute 'inoremap <buffer> <silent> '.a:key." <C-R>=AutoPairsInsert('".escaped_key."')<CR>"
+ execute 'inoremap <buffer> <silent> '.key." <C-R>=AutoPairsInsert('".escaped_key."')<CR>"
endfunction
function! AutoPairsToggle()

0 comments on commit f6a18ca

Please sign in to comment.