From 4005e0311f4dc951d3e9464ddf2f8f309d9b9a24 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 11:59:20 +0200 Subject: Create enabled direct acquisition previews --- tests/run.lua | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'tests/run.lua') diff --git a/tests/run.lua b/tests/run.lua index 9de914f..80294bb 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -4976,6 +4976,48 @@ test("Interactive acquisition redraws after cursor marker creation", function() same(0, #macro_host:redraws()) end) +test("Interactive acquisition creates enabled direct previews", function() + local state, transitions = fresh_sequence_state() + local host = MemoryHost.new({ + buffer_lines = { "xaxa" }, + cursor = { line = 1, byte_column = 1 }, + count = 2, + configuration = { + mark_cursor = false, + mark_direct = true, + ignore_case = false, + smart_case = false, + }, + }) + local service = acquisition_service.new({ + host = host, + transitions = transitions, + }) + + service:acquire("t", "n", host:read_cursor(), host:read_count(), nil) + local marker = service:last_temporary_scope().direct_marker + truthy(marker ~= nil) + same("CleverFDirect", marker.group) + same(1, #marker.positions) + same(domain.Position.new(1, 4), marker.positions[1]) + same(marker.identity, state:temporary_overlay_identities()[1]) + + fresh_sequence_state() + local macro_host = MemoryHost.new({ + buffer_lines = { "xaxa" }, + configuration = { mark_cursor = false, mark_direct = true }, + }) + local macro_service = acquisition_service.new(macro_host) + macro_service:acquire( + "f", + "n", + domain.Position.new(1, 1), + nil, + "q" + ) + same(nil, macro_service:last_temporary_scope().direct_marker) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then -- cgit v1.2.3