From c67ce4226f350671875d458a90604c6c4dec83db Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 13:41:50 +0200 Subject: Restore repeated primary feedback --- lua/clever_f/sequence_coordinator.lua | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'lua') diff --git a/lua/clever_f/sequence_coordinator.lua b/lua/clever_f/sequence_coordinator.lua index c5ee808..3f0b510 100644 --- a/lua/clever_f/sequence_coordinator.lua +++ b/lua/clever_f/sequence_coordinator.lua @@ -331,6 +331,29 @@ function SequenceCoordinator:build_movement_plan( return motion_plan end +function SequenceCoordinator:restore_repeated_feedback(resolution) + if type(resolution) ~= "table" + or not domain.TargetPlan.is(resolution.target_plan) + or not domain.ResolvedMotionPlan.is(resolution.motion_plan) + then + fail("feedback restoration requires a repeated primary resolution", 2) + end + local feedback = coordinator_records[self].feedback + if type(feedback.restore_primary) ~= "function" then + fail("FeedbackService must restore primary feedback", 2) + end + return feedback:restore_primary({ + context = resolution.invocation.context, + anchor = resolution.invocation.position, + target_plan = resolution.target_plan, + motion_plan = resolution.motion_plan, + stored_descriptor = resolution.stored_descriptor, + endpoint_policy = resolution.motion_plan.endpoint_policy, + text_view = resolution.text_view, + window = resolution.timeout.window, + }) +end + function SequenceCoordinator:stored_primary_resolution( invocation, pressed_descriptor, @@ -366,7 +389,7 @@ function SequenceCoordinator:stored_primary_resolution( invocation, search_scope ) - return { + local resolution = { kind = "repeat", invocation = invocation, pressed_descriptor = pressed_descriptor, @@ -379,6 +402,8 @@ function SequenceCoordinator:stored_primary_resolution( search_scope = search_scope, effective_descriptor = effective_descriptor, } + resolution.restored_feedback = self:restore_repeated_feedback(resolution) + return resolution end function SequenceCoordinator:primary(value) -- cgit v1.2.3