From 1a63017a9f780cb7d2a85ffb916012c9cee330ed Mon Sep 17 00:00:00 2001 From: Andrew Radev Date: Sun, 21 Sep 2014 15:54:37 +0200 Subject: [PATCH] Attempt to fix closing bracket bug --- indent/ruby.vim | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/indent/ruby.vim b/indent/ruby.vim index f2059982..843da06f 100644 --- a/indent/ruby.vim +++ b/indent/ruby.vim @@ -539,10 +539,17 @@ function GetRubyIndent(...) call cursor(lnum, closing.pos + 1) normal! % - if s:Match(line('.'), s:ruby_indent_keywords) - return indent('.') + &sw + let msl = line('.') + let tentative_msl = s:GetMSL(msl) + while msl != tentative_msl + let msl = tentative_msl + let tentative_msl = s:GetMSL(msl) + endwhile + + if s:Match(msl, s:ruby_indent_keywords) + return indent(msl) + &sw else - return indent('.') + return indent(msl) endif else call cursor(clnum, vcol)