support deleting empty multi-line pair

This commit is contained in:
jiangfriend@gmail.com 2012-03-04 00:59:38 +08:00
parent 207107a684
commit fac14bec63

View File

@ -149,6 +149,12 @@ function! AutoPairsDelete()
if match(line,'^\s*'.close, col('.')-1) != -1 if match(line,'^\s*'.close, col('.')-1) != -1
let space = matchstr(line, '^\s*', col('.')-1) let space = matchstr(line, '^\s*', col('.')-1)
return "\<BS>". repeat("\<DEL>", len(space)+1) return "\<BS>". repeat("\<DEL>", len(space)+1)
else
let nline = getline(line('.')+1)
if nline =~ '^\s*'.close
let space = matchstr(nline, '^\s*')
return "\<BS>\<DEL>". repeat("\<DEL>", len(space)+1)
end
end end
end end