Skip to content

Commit 4788a08

Browse files
committed
Remove broken s:IsInString check
The variable `line` doesn't really exist, but we've never gotten an error report, and I can't come up with a valid ruby syntax that actually hits this clause. The check looks at the end of the line and whether it's a string or comment, but we already do that in `s:MultilineStringOrLineComment`. The issue was discovered on this text: Indent tests failed: testdir/html.fail indent (this) line; So, a colon on the first line, some text that doesn't end in a continuation character, and the last line errors out. But I couldn't come up with a syntactically valid ruby combination that would hit it. So I removed the check completely.
1 parent e367f7b commit 4788a08

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

indent/ruby.vim

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,8 +642,7 @@ function! s:PreviousNotMSL(msl_info) abort
642642
" TODO (2016-10-07) Wrong/unused? How could it be "1"?
643643
return indent(info.plnum) - 1
644644
" If previous line is a continuation return its indent.
645-
" TODO: the || s:IsInString() thing worries me a bit.
646-
elseif s:Match(info.plnum, s:non_bracket_continuation_regex) || s:IsInString(info.plnum, strlen(line))
645+
elseif s:Match(info.plnum, s:non_bracket_continuation_regex)
647646
return indent(info.plnum)
648647
endif
649648
endif

0 commit comments

Comments
 (0)