From d3b2783bf1ac2804336a7e1cfa02fe90e03488eb Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 12:31:28 +0200 Subject: Build persistent target plans --- lua/clever_f/feedback_service.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lua/clever_f') diff --git a/lua/clever_f/feedback_service.lua b/lua/clever_f/feedback_service.lua index 084b30a..b6552ef 100644 --- a/lua/clever_f/feedback_service.lua +++ b/lua/clever_f/feedback_service.lua @@ -307,7 +307,7 @@ function M.persistent_context_eligible(context) or context.key == "cvr" end -function FeedbackService:request_persistent(specification) +function FeedbackService:build_persistent(specification) if type(specification) ~= "table" then fail("persistent feedback request must be a table", 2) end @@ -321,13 +321,20 @@ function FeedbackService:request_persistent(specification) if not domain.ResolvedMotionPlan.is(specification.motion_plan) then fail("persistent feedback request requires a ResolvedMotionPlan", 2) end - local request = { + if specification.motion_plan.target_plan ~= specification.target_plan then + fail("persistent feedback must reuse the movement TargetPlan", 2) + end + return { context = context, anchor = domain.Position.coerce(specification.anchor), target_plan = specification.target_plan, motion_plan = specification.motion_plan, window = specification.window, } +end + +function FeedbackService:request_persistent(specification) + local request = self:build_persistent(specification) local requests = service_records[self].persistent_requests requests[#requests + 1] = request return request -- cgit v1.2.3