lib/rubocop/cop/style/case_indentation.rb in rubocop-0.35.1 vs lib/rubocop/cop/style/case_indentation.rb in rubocop-0.36.0
- old
+ new
@@ -1,6 +1,7 @@
# encoding: utf-8
+# frozen_string_literal: true
module RuboCop
module Cop
module Style
# This cop checks how the *when*s of a *case* expression
@@ -62,10 +63,10 @@
end
end
def autocorrect(node)
when_column = node.location.keyword.column
- source_buffer = node.loc.expression.source_buffer
+ source_buffer = node.source_range.source_buffer
begin_pos = node.loc.keyword.begin_pos
whitespace = Parser::Source::Range.new(source_buffer,
begin_pos - when_column,
begin_pos)
return false unless whitespace.source.strip.empty?