summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/clever_f/motion_executor.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/lua/clever_f/motion_executor.lua b/lua/clever_f/motion_executor.lua
index c22bed9..f7722e8 100644
--- a/lua/clever_f/motion_executor.lua
+++ b/lua/clever_f/motion_executor.lua
@@ -112,8 +112,9 @@ local function require_transitions(transitions, state)
transitions = transitions or state_transitions.new(state)
if type(transitions) ~= "table"
or type(transitions.CommitCommandSuccess) ~= "function"
+ or type(transitions.CommitVisualSuccess) ~= "function"
then
- fail("MotionExecutor transitions must commit command success", 3)
+ fail("MotionExecutor transitions must commit motion success", 3)
end
return transitions
end
@@ -249,6 +250,13 @@ function MotionExecutor:_execute_visual(request)
if outcome.successful_steps > 0 then
host:apply_selection(selection:with_focus(outcome.endpoint))
end
+ if not outcome.complete then
+ return domain.ActionOutcome.from_search(outcome, request.plan.descriptor)
+ end
+ executor_records[self].transitions:CommitVisualSuccess(
+ request.context,
+ outcome.endpoint
+ )
return domain.ActionOutcome.from_search(outcome, request.plan.descriptor)
end