From 75879e3356685a145fab752c0b3365faa832f8d4 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 13:44:25 +0200 Subject: Refresh primary highlight timeout --- tests/run.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'tests/run.lua') diff --git a/tests/run.lua b/tests/run.lua index cf7edb9..d0838e8 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -7605,6 +7605,35 @@ test("Primary coordination executes resolved movement through MotionExecutor", f ) end) +test("Fresh and repeated primary actions refresh highlight timeout", function() + local state = fresh_sequence_state() + local host = MemoryHost.new({ + buffer_lines = { "aaaa" }, + cursor = { line = 1, byte_column = 1 }, + input_packets = { { kind = "text", text = "a" } }, + configuration = { + mark_cursor = false, + mark_char = true, + highlight_timeout_ms = 25, + }, + emit_movement_events = false, + }) + local coordinator = sequence_coordinator.new({ host = host }) + + same(domain.ActionKind.MOVEMENT, coordinator:primary("f").kind) + local fresh_timer = state.highlight_timer + truthy(fresh_timer ~= nil) + same(fresh_timer, coordinator:last_primary_resolution().highlight_timer) + + same(domain.ActionKind.MOVEMENT, coordinator:primary("f").kind) + local repeated_timer = state.highlight_timer + truthy(repeated_timer ~= nil) + falsy(fresh_timer == repeated_timer) + falsy(host:timers()[fresh_timer].active) + truthy(host:timers()[repeated_timer].active) + same(repeated_timer, coordinator:last_primary_resolution().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