summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:45:41 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:45:41 +0200
commiteee2fe5b78d903045d92efb33354107d600f8107 (patch)
treec16493773c0ec56abe8a9f61c43ec93e26267740 /tests
parent800ec4fae75b9bfb69b132ddffc28d88c8690a3b (diff)
Clear feedback from current timer
Diffstat (limited to 'tests')
-rw-r--r--tests/run.lua35
1 files changed, 34 insertions, 1 deletions
diff --git a/tests/run.lua b/tests/run.lua
index c3e7009..cdda346 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -6663,7 +6663,40 @@ test("Timer callbacks compare their identity with current state", function()
falsy(feedback:handle_highlight_timer(stale))
same(current, state.highlight_timer)
truthy(feedback:handle_highlight_timer(current))
- same(current, state.highlight_timer)
+ same(nil, state.highlight_timer)
+end)
+
+test("Current timer callback clears timer and character overlays", function()
+ local state, transitions = fresh_sequence_state()
+ local host = MemoryHost.new({
+ buffer_lines = { "aba" },
+ configuration = {
+ mark_char = true,
+ highlight_timeout_ms = 30,
+ },
+ })
+ local feedback = feedback_service.new({
+ host = host,
+ transitions = transitions,
+ })
+ local shared_target = target_plan.build(target("a"), matching_policy())
+ local movement = motion_plan.build(shared_target, "f")
+ local persistent = feedback:request_persistent({
+ context = "n",
+ anchor = domain.Position.new(1, 1),
+ target_plan = shared_target,
+ motion_plan = movement,
+ window = "window-1",
+ })
+ local timer = feedback:start_highlight_timer("window-1")
+
+ truthy(host:fire_timer(timer))
+
+ same(nil, state.highlight_timer)
+ same(0, #state.target_overlays)
+ same(nil, host:highlights()[persistent.identity])
+ same(1, #state.finalizers)
+ falsy(host:timers()[timer].active)
end)
for _, item in ipairs(tests) do