From 4387105882517c8f945279290ba1b381f9530ece Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Tue, 7 Nov 2017 15:41:36 +0100 Subject: [PATCH] Auto-close now detects closing tag on next line --- vimrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vimrc b/vimrc index b2625a1..8868f8d 100644 --- a/vimrc +++ b/vimrc @@ -107,9 +107,10 @@ function! s:autoClose_HelperOpen(open, close) endfunc function! s:autoClose_HelperClose(open, close) - let next_c = getline(".")[col(".")-1] - if next_c ==# a:close + if getline(".")[col(".")-1] ==# a:close return "\" + elseif match(getline("."+1), "\M^\s*".escape(a:close, "\\")) + return "\\\f".a:close."\" else return a:close end @@ -502,6 +503,7 @@ function! s:init_ruby_file() call s:autoClose_AddPair("{", "}") call s:autoClose_AddPair("(", ")") + call s:autoClose_AddPair("[", "]") endfunction function! s:RubyComment(a)