diff --git a/plugin/auto-pairs.vim b/plugin/auto-pairs.vim index fd4c69d..5222c48 100644 --- a/plugin/auto-pairs.vim +++ b/plugin/auto-pairs.vim @@ -442,10 +442,9 @@ function! AutoPairsInit() endfunction -function! s:ExpandMap(map, sid) +function! s:ExpandMap(map) let map = a:map let map = substitute(map, '\(\w\+\)', '\=maparg(submatch(1), "i")', 'g') - let map = substitute(map, '', '' . a:sid . '_', 'g') return map endfunction @@ -468,23 +467,42 @@ function! AutoPairsTryInit() " Buffer level keys mapping " comptible with other plugin if g:AutoPairsMapCR - let info = maparg('', 'i', 0, 1) - if !empty(info) - let old_cr = info['rhs'] - if old_cr !~ 'AutoPairsReturn' - let old_cr = s:ExpandMap(old_cr, info['sid']) - if info['expr'] - " remap to `name` to avoid mix expr and non-expr mode - let name = 'AutoPairsOldCRWrapper' - execute 'inoremap