def between(start_line, end_line=nil)
return self unless start_line
if start_line.is_a? Range
end_line = start_line.last
end_line -= 1 if start_line.exclude_end?
start_line = start_line.first
else
end_line ||= start_line
end
if start_line > 0
start_idx = @lines.index { |l| l.last >= start_line } || @lines.length
else
start_idx = start_line
end
if end_line > 0
end_idx = (@lines.index { |l| l.last > end_line } || 0) - 1
else
end_idx = end_line
end
alter do
@lines = @lines[start_idx..end_idx] || []
end
end