summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lua/clever_f/sequence_coordinator.lua4
-rw-r--r--tests/run.lua24
2 files changed, 28 insertions, 0 deletions
diff --git a/lua/clever_f/sequence_coordinator.lua b/lua/clever_f/sequence_coordinator.lua
index 3f0b510..5a05f53 100644
--- a/lua/clever_f/sequence_coordinator.lua
+++ b/lua/clever_f/sequence_coordinator.lua
@@ -247,6 +247,9 @@ function SequenceCoordinator:fresh_primary_resolution(
target_plan = acquisition_result.target_plan,
motion_plan = acquisition_result.motion_plan,
effective_descriptor = initiating_descriptor,
+ first_move = coordinator_records[self].state:get_first_move(
+ invocation.context
+ ) == true,
skip_destination = acquisition_result.target_plan.kind
== domain.TargetPlanKind.EMPTY,
}
@@ -401,6 +404,7 @@ function SequenceCoordinator:stored_primary_resolution(
text_view = text_view,
search_scope = search_scope,
effective_descriptor = effective_descriptor,
+ first_move = state:get_first_move(invocation.context) == true,
}
resolution.restored_feedback = self:restore_repeated_feedback(resolution)
return resolution
diff --git a/tests/run.lua b/tests/run.lua
index b577512..3c45045 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -7539,6 +7539,30 @@ test("Primary repetition restores stored-descriptor feedback before movement", f
)
end)
+test("Primary resolutions carry current first-move state", function()
+ local _, transitions = fresh_sequence_state()
+ local fresh_host = MemoryHost.new({
+ buffer_lines = { "aba" },
+ input_packets = { { kind = "text", text = "a" } },
+ configuration = {
+ mark_cursor = false,
+ mark_char = false,
+ },
+ })
+ local fresh = sequence_coordinator.new({ host = fresh_host }):primary("t")
+ truthy(fresh.first_move)
+
+ local landing = domain.Position.new(1, 3)
+ transitions:CommitCommandSuccess("n", landing, true)
+ local repeated_host = MemoryHost.new({
+ buffer_lines = { "ababa" },
+ cursor = landing,
+ configuration = { mark_char = false },
+ })
+ local repeated = sequence_coordinator.new({ host = repeated_host }):primary("t")
+ falsy(repeated.first_move)
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then