From e44e0d3f81d3c959a5a9035b0a816ffb632ab463 Mon Sep 17 00:00:00 2001 From: Manuel Fittko Date: Fri, 8 Nov 2024 11:05:07 +0100 Subject: [PATCH] try to fix missing correction at pos 0 --- rdjson_formatter/rdjson_formatter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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