diff options
Diffstat (limited to 'lua/clever_f')
| -rw-r--r-- | lua/clever_f/motion_executor.lua | 7 |
1 files changed, 7 insertions, 0 deletions
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 |
