Added logging for debug

This commit is contained in:
Léopold Mebazaa 2019-10-11 22:28:58 -04:00
parent 562a72ea88
commit b1c7fea825

View File

@ -212,11 +212,20 @@ func! AutoPairsInsert(key)
return a:key
end
echom "gline: ".string(s:getline())
" check open pairs
for [open, close, opt] in b:AutoPairsList
let ms = s:matchend(before.a:key, open)
let m = matchstr(afterline, '^\v\s*\zs\V'.close)
if len(ms) > 0
echom "beg?: ".string(matchstr(before.a:key, '\V'.open.'\v$'))
echom "pair: ".string([open, close, opt])
echom "ms: ".string(ms)
echom "m: ".string(m)
echom "key: ".string(a:key)
" If the pair has no corresponding closing string, why bother
if close == ''
break
elseif len(ms) > 0
" process the open pair
" remove inserted pair
@ -224,7 +233,7 @@ func! AutoPairsInsert(key)
" when <!-- is detected the inserted pair < > should be clean up
let target = ms[1]
let openPair = ms[2]
if len(openPair) == 1 && m == openPair
if (len(openPair) == 1 && m == openPair)
break
end
let bs = ''
@ -292,7 +301,6 @@ func! AutoPairsInsert(key)
end
endfor
" Fly Mode, and the key is closed-pairs, search closed-pair and jump
if g:AutoPairsFlyMode && a:key =~ '\v[\}\]\)]'
if search(a:key, 'We')