From f9c8b8dcc072bc82302217f3a2353e3d351160f8 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 11:44:56 +0200 Subject: Mark TILL target occurrences --- tests/run.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') diff --git a/tests/run.lua b/tests/run.lua index 718488b..458b521 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -4735,6 +4735,23 @@ test("Smart-case previews mark the exact and lowercase union", function() same(domain.Position.new(1, 3), one_marker[1]) end) +test("TILL direct previews retain target occurrence positions", function() + local planner = direct_preview_planner.new({ lowercase = string.lower }) + local view = text_topology.new({ "xaxa" }, "utf-8") + local origin = domain.Position.new(1, 1) + + local find_positions = planner:plan(view, origin, "f", 2) + local till_positions = planner:plan(view, origin, "t", 2) + same(1, #find_positions) + same(1, #till_positions) + same(domain.Position.new(1, 4), find_positions[1]) + same(find_positions[1], till_positions[1]) + same( + domain.Position.new(1, 4), + direct_preview_planner.marker_position("t", domain.Position.new(1, 4)) + ) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then -- cgit v1.2.3