summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lua/clever_f/acquisition_service.lua1
-rw-r--r--tests/run.lua22
2 files changed, 23 insertions, 0 deletions
diff --git a/lua/clever_f/acquisition_service.lua b/lua/clever_f/acquisition_service.lua
index b1bb983..da9ae0f 100644
--- a/lua/clever_f/acquisition_service.lua
+++ b/lua/clever_f/acquisition_service.lua
@@ -339,6 +339,7 @@ function AcquisitionService:acquire(descriptor, context, position, count, macro_
if acquisition.show_prompt and not request.macro_state.executing then
record.host:show_prompt(M.PROMPT)
end
+ record.transitions:BeginAcquisition(request.context, request.descriptor)
return request
end
diff --git a/tests/run.lua b/tests/run.lua
index 5584c50..cab79c5 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -5065,6 +5065,28 @@ test("Acquisition emits the exact enabled prompt", function()
same(0, #macro_host:prompts())
end)
+test("Acquisition begins sequence state before input", function()
+ local state, transitions = fresh_sequence_state()
+ local host = MemoryHost.new({
+ configuration = { mark_cursor = false },
+ })
+ acquisition_service.new({
+ host = host,
+ transitions = transitions,
+ }):acquire(
+ "T",
+ "nov",
+ domain.Position.new(1, 1),
+ nil,
+ nil
+ )
+
+ local record = state:get_context("no")
+ same(domain.Descriptor.TILL_BACKWARD, record.previous_descriptor)
+ truthy(record.first_move)
+ same(nil, record.previous_target)
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then