diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 13:44:25 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 13:44:25 +0200 |
| commit | 75879e3356685a145fab752c0b3365faa832f8d4 (patch) | |
| tree | 9f7ea6967127d42fe1a244fcb8b7dc652db7cd9b /lua/clever_f | |
| parent | f3000e4cab6255680e77256140c96a6decdba9c9 (diff) | |
Refresh primary highlight timeout
Diffstat (limited to 'lua/clever_f')
| -rw-r--r-- | lua/clever_f/sequence_coordinator.lua | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/lua/clever_f/sequence_coordinator.lua b/lua/clever_f/sequence_coordinator.lua index ee50fbd..cb6bf80 100644 --- a/lua/clever_f/sequence_coordinator.lua +++ b/lua/clever_f/sequence_coordinator.lua @@ -424,6 +424,19 @@ function SequenceCoordinator:stored_primary_resolution( return resolution end +function SequenceCoordinator:refresh_primary_feedback(resolution) + if type(resolution) ~= "table" or not domain.TargetValue.is(resolution.target) then + fail("primary feedback refresh requires a resolved target", 2) + end + local record = coordinator_records[self] + if type(record.feedback.refresh_primary) ~= "function" then + fail("FeedbackService must refresh primary feedback", 2) + end + local window = resolution.timeout and resolution.timeout.window + or record.host:read_window() + return record.feedback:refresh_primary(resolution.target, window) +end + function SequenceCoordinator:execute_primary_resolution(resolution) if type(resolution) ~= "table" or not domain.ModeContext.is(resolution.invocation.context) @@ -433,20 +446,23 @@ function SequenceCoordinator:execute_primary_resolution(resolution) end local record = coordinator_records[self] record.last_primary_resolution = resolution + local outcome if resolution.skip_destination then - return domain.ActionOutcome.empty(resolution.invocation.position) - end - local view = resolution.text_view or text_topology.from_host(record.host) - local outcome = record.motion_executor:execute( - view, - resolution.invocation.context, - resolution.motion_plan, - resolution.invocation.count, - resolution.first_move - ) - if not domain.ActionOutcome.is(outcome) then - fail("MotionExecutor must return an ActionOutcome", 2) + outcome = domain.ActionOutcome.empty(resolution.invocation.position) + else + local view = resolution.text_view or text_topology.from_host(record.host) + outcome = record.motion_executor:execute( + view, + resolution.invocation.context, + resolution.motion_plan, + resolution.invocation.count, + resolution.first_move + ) + if not domain.ActionOutcome.is(outcome) then + fail("MotionExecutor must return an ActionOutcome", 2) + end end + resolution.highlight_timer = self:refresh_primary_feedback(resolution) return outcome end |
