Skip to content

Commit

Permalink
Add a workaround for #887, fixing negative source range lengths.
Browse files Browse the repository at this point in the history
  • Loading branch information
srawlins authored and sds committed May 8, 2017
1 parent 3f16180 commit dca4aab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/scss_lint/linter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ def location_from_range(range) # rubocop:disable Metrics/AbcSize
line_source.length - range.start_pos.offset + 1
end

# Workaround for https://github.com/brigade/scss-lint/issues/887 to acount for
# https://github.com/sass/sass/issues/2284.
length = 1 if length < 1

Location.new(range.start_pos.line, range.start_pos.offset, length)
end

Expand Down

0 comments on commit dca4aab

Please sign in to comment.