From ba60993e80bc7e9d770639fb31a2b681cfd99e2e Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 12:47:55 +0200 Subject: Refresh resolved primary timer --- tests/run.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'tests') diff --git a/tests/run.lua b/tests/run.lua index 2d343b6..2f470d8 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -6835,6 +6835,32 @@ test("Primary repetition restores feedback before movement", function() truthy(create_index < movement_index) end) +test("Resolved primary actions refresh the highlight timer", function() + local state, transitions = fresh_sequence_state() + local host = MemoryHost.new({ + configuration = { + mark_char = true, + highlight_timeout_ms = 15, + }, + }) + local feedback = feedback_service.new({ + host = host, + transitions = transitions, + }) + local resolved = target("a") + + local fresh = feedback:refresh_primary(resolved, "window-1") + same(fresh, state.highlight_timer) + local repeated = feedback:refresh_primary(resolved, "window-1") + same(repeated, state.highlight_timer) + falsy(fresh == repeated) + falsy(host:timers()[fresh].active) + truthy(host:timers()[repeated].active) + + same(nil, feedback:refresh_primary(nil, "window-1")) + same(repeated, state.highlight_timer) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then -- cgit v1.2.3