summaryrefslogtreecommitdiff
path: root/lua/clever_f/motion_executor.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/clever_f/motion_executor.lua')
-rw-r--r--lua/clever_f/motion_executor.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/lua/clever_f/motion_executor.lua b/lua/clever_f/motion_executor.lua
index 5dba08f..0c49ce1 100644
--- a/lua/clever_f/motion_executor.lua
+++ b/lua/clever_f/motion_executor.lua
@@ -54,8 +54,9 @@ end
local function require_host(host)
if type(host) ~= "table"
or type(host.read_cursor) ~= "function"
+ or type(host.apply_cursor) ~= "function"
then
- fail("MotionExecutor host must provide read_cursor", 3)
+ fail("MotionExecutor host must provide cursor movement", 3)
end
return host
end
@@ -134,6 +135,9 @@ function MotionExecutor:_execute_command(request)
local host = executor_records[self].host
local origin = host:read_cursor()
local outcome = calculate(self, request, origin)
+ if outcome.successful_steps > 0 then
+ host:apply_cursor(outcome.endpoint)
+ end
return domain.ActionOutcome.from_search(outcome, request.plan.descriptor)
end