From 4477c8c0f4007e269f5ae4835026f761c45a2773 Mon Sep 17 00:00:00 2001 From: makicamel Date: Mon, 9 Oct 2023 15:41:33 +0900 Subject: [PATCH] Fix bug; assign nil to `@index` when instance variable is not found --- lib/bulletmark_repairer/markers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bulletmark_repairer/markers.rb b/lib/bulletmark_repairer/markers.rb index f6d354f..78f9048 100644 --- a/lib/bulletmark_repairer/markers.rb +++ b/lib/bulletmark_repairer/markers.rb @@ -75,7 +75,7 @@ def set_up @instance_variable_name = line&.scan(/\b?(@[\w]+)\b?/)&.flatten&.last end end - @index = view_yield_index.negative? ? nil : "#{view_file}:#{view_yield_index}" + @index = @instance_variable_name ? "#{view_file}:#{view_yield_index}" : nil else # TODO: Ignore controllers list # TODO: Allow directories list