diff --git a/plugin/auto-pairs.vim b/plugin/auto-pairs.vim index d8b3aa7..216d58a 100644 --- a/plugin/auto-pairs.vim +++ b/plugin/auto-pairs.vim @@ -120,7 +120,7 @@ func! s:getline() let before = strpart(line, 0, pos) let after = strpart(line, pos) let afterline = after - if a:0 == 0 && g:AutoPairsMultilineClose + if g:AutoPairsMultilineClose let n = line('$') let i = line('.')+1 while i <= n @@ -136,6 +136,7 @@ func! s:getline() endf " split text to two part +" returns [orig, text_before_open, open] func! s:matchend(text, open) let m = matchstr(a:text, '\V'.a:open.'\v$') if m == "" @@ -144,6 +145,7 @@ func! s:matchend(text, open) return [a:text, strpart(a:text, 0, len(a:text)-len(m)), m] endf +" returns [orig, close, text_after_close] func! s:matchbegin(text, close) let m = matchstr(a:text, '^\V'.a:close) if m == "" @@ -223,39 +225,36 @@ func! AutoPairsInsert(key) " remove inserted pair " eg: if the pairs include < > and " when