diff options
-rw-r--r-- | lib/syntax_suggest/clean_document.rb | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -224,7 +224,7 @@ module SyntaxSuggest # def join_consecutive! consecutive_groups = @document.select(&:ignore_newline_not_beg?).map do |code_line| - take_while_including(code_line.index..-1) do |line| line.ignore_newline_not_beg? end end @@ -245,7 +245,7 @@ module SyntaxSuggest # expect(lines[1].to_s).to eq("") def join_trailing_slash! trailing_groups = @document.select(&:trailing_slash?).map do |code_line| - take_while_including(code_line.index..-1) { |x| x.trailing_slash? } end join_groups(trailing_groups) self @@ -279,7 +279,7 @@ module SyntaxSuggest ) # Hide the rest of the lines - lines[1..-1].each do |line| # The above lines already have newlines in them, if add more # then there will be double newline, use an empty line instead @document[line.index] = CodeLine.new(line: "", index: line.index, lex: []) @@ -293,7 +293,7 @@ module SyntaxSuggest # Like `take_while` except when it stops # iterating, it also returns the line # that caused it to stop - def take_while_including(range = 0..-1) take_next_and_stop = false @document[range].take_while do |line| next if take_next_and_stop |