diff --git a/rdjson_formatter/rdjson_formatter.rb b/rdjson_formatter/rdjson_formatter.rb index 9523b1c..56397e6 100644 --- a/rdjson_formatter/rdjson_formatter.rb +++ b/rdjson_formatter/rdjson_formatter.rb @@ -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