Skip to content

Commit

Permalink
try to fix missing correction at pos 0
Browse files Browse the repository at this point in the history
  • Loading branch information
mfittko committed Nov 8, 2024
1 parent 59b2d79 commit e44e0d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rdjson_formatter/rdjson_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def build_suggestions(offense)
sorted_corrections = corrections.sort_by { |range, _| range.begin_pos }

sorted_corrections.each do |range, replacement_text|
next if range.end_pos <= min_begin_pos || range.begin_pos >= max_end_pos
next if range.end_pos < min_begin_pos || range.begin_pos > max_end_pos

corrected_text += source_buffer.source[current_pos...range.begin_pos] if current_pos < range.begin_pos
corrected_text += replacement_text.to_s
Expand Down

0 comments on commit e44e0d3

Please sign in to comment.