Auto-close now detects closing tag on next line
This commit is contained in:
parent
5b8f2255cc
commit
4387105882
1 changed files with 4 additions and 2 deletions
6
vimrc
6
vimrc
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue