diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:44:56 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:44:56 +0200 |
| commit | f9c8b8dcc072bc82302217f3a2353e3d351160f8 (patch) | |
| tree | eee5c16fa353ebed24c9875c6a81055145c9d9c1 /tests | |
| parent | 5a51b5692e29ac4ab2ceda5888126745b99823d7 (diff) | |
Mark TILL target occurrences
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run.lua | 17 |
1 files changed, 17 insertions, 0 deletions
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 |
