From 33e93f67e78d3a502401442f80ff2572ed35d5dd Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 10:49:08 +0200 Subject: Compare command destinations --- lua/clever_f/motion_executor.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lua/clever_f') diff --git a/lua/clever_f/motion_executor.lua b/lua/clever_f/motion_executor.lua index 3d6caf5..9718640 100644 --- a/lua/clever_f/motion_executor.lua +++ b/lua/clever_f/motion_executor.lua @@ -25,6 +25,12 @@ function M.execution_path(context) return M.ExecutionPath.COMMAND end +function M.moved_forward(origin, destination) + origin = domain.Position.coerce(origin) + destination = domain.Position.coerce(destination) + return domain.Position.compare(destination, origin) > 0 +end + local function copy_options(options) local result = {} for key, value in pairs(options or {}) do @@ -141,6 +147,7 @@ function MotionExecutor:_execute_command(request) if not outcome.complete then return domain.ActionOutcome.from_search(outcome, request.plan.descriptor) end + request.moved_forward = M.moved_forward(origin, outcome.endpoint) return domain.ActionOutcome.from_search(outcome, request.plan.descriptor) end -- cgit v1.2.3