diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:58:14 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:58:14 +0200 |
| commit | 61233d0cfb09f6d5a42c48eb31df5edf1d91c12f (patch) | |
| tree | 72d935b6d28d9ce07181efbc4e6ba714b08aa8f8 | |
| parent | 385be6c13c70bc458b13f000cbc59f07fb963182 (diff) | |
Redraw interactive cursor marker
| -rw-r--r-- | lua/clever_f/acquisition_service.lua | 3 | ||||
| -rw-r--r-- | tests/run.lua | 35 |
2 files changed, 38 insertions, 0 deletions
diff --git a/lua/clever_f/acquisition_service.lua b/lua/clever_f/acquisition_service.lua index a68e458..3c7cc14 100644 --- a/lua/clever_f/acquisition_service.lua +++ b/lua/clever_f/acquisition_service.lua @@ -277,6 +277,9 @@ function AcquisitionService:acquire(descriptor, context, position, count, macro_ request.position, current_window(record) )) + if not request.macro_state.executing then + record.host:redraw("screen") + end end return request end diff --git a/tests/run.lua b/tests/run.lua index 87f54b3..9de914f 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -4941,6 +4941,41 @@ test("Acquisition creates cursor markers only when enabled", function() same(nil, disabled:last_temporary_scope().cursor_marker) end) +test("Interactive acquisition redraws after cursor marker creation", function() + fresh_sequence_state() + local host = MemoryHost.new({ + configuration = { mark_cursor = true }, + }) + local service = acquisition_service.new(host) + service:acquire("f", "n", domain.Position.new(1, 1), nil, nil) + + local create_index + local redraw_index + for index, operation in ipairs(host:operations()) do + if operation.operation == "create_highlight" then + create_index = index + elseif operation.operation == "redraw" then + redraw_index = index + end + end + truthy(create_index ~= nil) + truthy(redraw_index > create_index) + list_same({ "screen" }, host:redraws()) + + fresh_sequence_state() + local macro_host = MemoryHost.new({ + configuration = { mark_cursor = true }, + }) + acquisition_service.new(macro_host):acquire( + "f", + "n", + domain.Position.new(1, 1), + nil, + domain.MacroState.new("q") + ) + same(0, #macro_host:redraws()) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then |
