Auto-close now detects closing tag on next line

This commit is contained in:
Talia 2017-11-07 15:41:36 +01:00
parent 5b8f2255cc
commit 4387105882

6
vimrc
View file

@ -107,9 +107,10 @@ function! s:autoClose_HelperOpen(open, close)
endfunc endfunc
function! s:autoClose_HelperClose(open, close) function! s:autoClose_HelperClose(open, close)
let next_c = getline(".")[col(".")-1] if getline(".")[col(".")-1] ==# a:close
if next_c ==# a:close
return "\<Right>" return "\<Right>"
elseif match(getline("."+1), "\M^\s*".escape(a:close, "\\"))
return "\<Down>\<Home>\<C-o>f".a:close."\<Right>"
else else
return a:close return a:close
end end
@ -502,6 +503,7 @@ function! s:init_ruby_file()
call s:autoClose_AddPair("{", "}") call s:autoClose_AddPair("{", "}")
call s:autoClose_AddPair("(", ")") call s:autoClose_AddPair("(", ")")
call s:autoClose_AddPair("[", "]")
endfunction endfunction
function! s:RubyComment(a) function! s:RubyComment(a)