Skip to content

Commit 1a63017

Browse files
committed
Attempt to fix closing bracket bug
1 parent 5bc55be commit 1a63017

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

indent/ruby.vim

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,10 +539,17 @@ function GetRubyIndent(...)
539539
call cursor(lnum, closing.pos + 1)
540540
normal! %
541541

542-
if s:Match(line('.'), s:ruby_indent_keywords)
543-
return indent('.') + &sw
542+
let msl = line('.')
543+
let tentative_msl = s:GetMSL(msl)
544+
while msl != tentative_msl
545+
let msl = tentative_msl
546+
let tentative_msl = s:GetMSL(msl)
547+
endwhile
548+
549+
if s:Match(msl, s:ruby_indent_keywords)
550+
return indent(msl) + &sw
544551
else
545-
return indent('.')
552+
return indent(msl)
546553
endif
547554
else
548555
call cursor(clnum, vcol)

0 commit comments

Comments
 (0)