use <expr> instead of <C-R> in map keys

This commit is contained in:
jiangfriend@gmail.com 2011-06-11 11:12:20 +08:00
parent e379fa2316
commit f2b2fdee43

View File

@ -182,15 +182,15 @@ function! AutoPairsInit()
endfor endfor
if g:AutoPairsMapBS if g:AutoPairsMapBS
execute 'inoremap <buffer> <silent> <BS> <C-R>=AutoPairsDelete()<CR>' execute 'inoremap <buffer> <silent> <expr> <BS> AutoPairsDelete()'
end end
if g:AutoPairsMapCR if g:AutoPairsMapCR
execute 'inoremap <buffer> <silent> <CR> <C-R>=AutoPairsReturn()<CR>' execute 'inoremap <buffer> <silent> <expr> <CR> AutoPairsReturn()'
end end
execute 'inoremap <buffer> <silent> '.g:AutoPairsShortcutFastWrap.' <C-R>=AutoPairsFastWrap()<CR>' execute 'inoremap <buffer> <silent> '.g:AutoPairsShortcutFastWrap.' <C-R>=AutoPairsFastWrap()<CR>'
execute 'inoremap <buffer> <silent> '.g:AutoPairsShortcutToggle.' <C-R>=AutoPairsToggle()<CR>' execute 'inoremap <buffer> <silent> <expr> '.g:AutoPairsShortcutToggle.' AutoPairsToggle()'
execute 'noremap <buffer> <silent> '.g:AutoPairsShortcutToggle.' :call AutoPairsToggle()<CR>' execute 'noremap <buffer> <silent> '.g:AutoPairsShortcutToggle.' :call AutoPairsToggle()<CR>'
" If the keys map conflict with your own settings, delete or change them " If the keys map conflict with your own settings, delete or change them
if g:AutoPairsShortcuts if g:AutoPairsShortcuts