class Rufo::Formatter

def dedent_calls

def dedent_calls
  return if @line_to_call_info.empty?
  lines = @output.lines
  while line_to_call_info = @line_to_call_info.shift
    first_line, call_info = line_to_call_info
    next unless call_info.size == 5
    indent, first_param_indent, needs_dedent, first_paren_end_line, last_line = call_info
    next unless needs_dedent
    next unless first_paren_end_line == last_line
    diff = first_param_indent - indent
    (first_line + 1..last_line).each do |line|
      @line_to_call_info.delete(line)
      next if @unmodifiable_string_lines[line]
      current_line = lines[line]
      current_line = current_line[diff..-1]
      # It can happen that this line didn't need an indent because
      # it simply had a newline
      if current_line
        lines[line] = current_line
        adjust_other_alignments nil, line, 0, -diff
      end
    end
  end
  @output = lines.join
end