From 26e79b1a99624c43c4149bd09b047af19c615a1c Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 10:49:27 +0200 Subject: Classify stationary TILL moves --- lua/clever_f/motion_executor.lua | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'lua/clever_f') diff --git a/lua/clever_f/motion_executor.lua b/lua/clever_f/motion_executor.lua index 9718640..b66f0b7 100644 --- a/lua/clever_f/motion_executor.lua +++ b/lua/clever_f/motion_executor.lua @@ -31,6 +31,18 @@ function M.moved_forward(origin, destination) return domain.Position.compare(destination, origin) > 0 end +function M.command_moved_forward(descriptor, origin, destination) + descriptor = domain.Descriptor.from_string(descriptor) + origin = domain.Position.coerce(origin) + destination = domain.Position.coerce(destination) + if descriptor.family == domain.Family.TILL + and domain.Position.stationary(origin, destination) + then + return false + end + return M.moved_forward(origin, destination) +end + local function copy_options(options) local result = {} for key, value in pairs(options or {}) do @@ -147,7 +159,11 @@ 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) + request.moved_forward = M.command_moved_forward( + request.plan.descriptor, + origin, + outcome.endpoint + ) return domain.ActionOutcome.from_search(outcome, request.plan.descriptor) end -- cgit v1.2.3