From d3288bd81eb106ec0100030e6cce083231355329 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 12:16:32 +0200 Subject: Suppress macro acquisition redraws --- tests/run.lua | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'tests') diff --git a/tests/run.lua b/tests/run.lua index b4519fe..1c7d39e 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -5656,6 +5656,43 @@ test("Each macro acquisition consumes and commits input", function() same(2, reads) end) +test("Macro acquisition skips direct planning and all redraws", function() + fresh_sequence_state() + local direct_calls = 0 + local direct_planner = { + plan = function() + direct_calls = direct_calls + 1 + error("macro direct planner must stay idle") + end, + } + local host = MemoryHost.new({ + buffer_lines = { "abc" }, + configuration = { + mark_cursor = true, + mark_direct = true, + mark_char = false, + show_prompt = true, + }, + input_packets = { { kind = "text", text = "b" } }, + }) + local service = acquisition_service.new({ + host = host, + direct_planner = direct_planner, + }) + + local result = service:acquire( + "f", + "n", + domain.Position.new(1, 1), + nil, + "q" + ) + same("b", result.target.value) + same(0, direct_calls) + same(nil, service:last_temporary_scope().direct_marker) + same(0, #host:redraws()) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then -- cgit v1.2.3