diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 12:43:25 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 12:43:25 +0200 |
| commit | f43bc1874ecb8a2b8230e3af82a5a28170bfd810 (patch) | |
| tree | 7039ab3a6fb382523e28aabd3598efc403aa40d8 | |
| parent | faa4a7a22a1e1022b4a826dd8713cd4a0ff4a37b (diff) | |
Retain Visual feedback anchor
| -rw-r--r-- | tests/run.lua | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua index e9c91b1..c626444 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -6517,6 +6517,50 @@ test("Direction-changing repeated TILL rebuilds feedback", function() same(1, #state.target_overlays) end) +test("Visual movement retains its persistent feedback anchor", function() + local state, transitions = fresh_sequence_state() + local origin = domain.Position.new(1, 1) + local host = MemoryHost.new({ + buffer_lines = { "a", "x" }, + cursor = origin, + mode = "v", + selection = domain.Selection.active( + domain.SelectionKind.CHARACTER, + origin, + origin, + domain.SelectionOption.INCLUSIVE + ), + }) + local feedback = feedback_service.new({ + host = host, + transitions = transitions, + }) + local shared_target = target_plan.build(target("x"), matching_policy()) + local movement = motion_plan.build(shared_target, "f") + transitions:BeginAcquisition("v", "f") + transitions:CommitAcquiredTarget("v", target("x")) + local persistent = feedback:request_persistent({ + context = "v", + anchor = origin, + target_plan = shared_target, + motion_plan = movement, + window = "window-1", + }) + local token = host:begin_action_transition() + local outcome = motion_executor.new({ + host = host, + feedback_service = feedback, + transitions = transitions, + }):execute(text_topology.from_host(host), "v", movement, 1, true) + host:commit_action_transition(token) + + same(domain.ActionKind.MOVEMENT, outcome.kind) + same(domain.Position.new(2, 1), state:get_previous_landing("v")) + same(persistent.identity, state.target_overlays[1].identity) + same(1, state.target_overlays[1].anchor_line) + truthy(host:highlights()[persistent.identity] ~= nil) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then |
