@@ -224,7 +224,7 @@ def join_heredoc!
224
224
#
225
225
def join_consecutive!
226
226
consecutive_groups = @document . select ( &:ignore_newline_not_beg? ) . map do |code_line |
227
- take_while_including ( code_line . index ..- 1 ) do |line |
227
+ take_while_including ( code_line . index ..) do |line |
228
228
line . ignore_newline_not_beg?
229
229
end
230
230
end
@@ -245,7 +245,7 @@ def join_consecutive!
245
245
# expect(lines[1].to_s).to eq("")
246
246
def join_trailing_slash!
247
247
trailing_groups = @document . select ( &:trailing_slash? ) . map do |code_line |
248
- take_while_including ( code_line . index ..- 1 ) { |x | x . trailing_slash? }
248
+ take_while_including ( code_line . index ..) { |x | x . trailing_slash? }
249
249
end
250
250
join_groups ( trailing_groups )
251
251
self
@@ -279,7 +279,7 @@ def join_groups(groups)
279
279
)
280
280
281
281
# Hide the rest of the lines
282
- lines [ 1 ..- 1 ] . each do |line |
282
+ lines [ 1 ..] . each do |line |
283
283
# The above lines already have newlines in them, if add more
284
284
# then there will be double newline, use an empty line instead
285
285
@document [ line . index ] = CodeLine . new ( line : "" , index : line . index , lex : [ ] )
@@ -293,7 +293,7 @@ def join_groups(groups)
293
293
# Like `take_while` except when it stops
294
294
# iterating, it also returns the line
295
295
# that caused it to stop
296
- def take_while_including ( range = 0 ..- 1 )
296
+ def take_while_including ( range = 0 ..)
297
297
take_next_and_stop = false
298
298
@document [ range ] . take_while do |line |
299
299
next if take_next_and_stop
0 commit comments