lib/rubocop/cop/layout/initial_indentation.rb in rubocop-0.51.0 vs lib/rubocop/cop/layout/initial_indentation.rb in rubocop-0.52.0

- old
+ new

@@ -24,19 +24,21 @@ processed_source.tokens.find { |t| !t.text.start_with?('#') } end def space_before(token) return unless token - return if token.pos.column.zero? + return if token.column.zero? - token_with_space = - range_with_surrounding_space(token.pos, :left, false) + space_range = + range_with_surrounding_space(range: token.pos, + side: :left, + newlines: false) # If the file starts with a byte order mark (BOM), the column can be # non-zero, but then we find out here if there's no space to the left # of the first token. - return if token_with_space == token.pos + return if space_range == token.pos - yield range_between(token_with_space.begin_pos, token.pos.begin_pos) + yield range_between(space_range.begin_pos, token.begin_pos) end end end end end