From 0668744a8f18edd1da4914f901bf6f108ab2fd81 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 10:52:25 +0200 Subject: Toggle forward operator inclusivity --- lua/clever_f/motion_executor.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lua/clever_f') diff --git a/lua/clever_f/motion_executor.lua b/lua/clever_f/motion_executor.lua index f7722e8..7a0755b 100644 --- a/lua/clever_f/motion_executor.lua +++ b/lua/clever_f/motion_executor.lua @@ -77,6 +77,7 @@ local function require_host(host) or type(host.read_selection) ~= "function" or type(host.apply_cursor) ~= "function" or type(host.apply_selection) ~= "function" + or type(host.set_operator_inclusive) ~= "function" then fail("MotionExecutor host must provide movement state", 3) end @@ -216,6 +217,11 @@ function MotionExecutor:_execute_command(request) local origin = host:read_cursor() local outcome = calculate(self, request, origin) if outcome.successful_steps > 0 then + if request.context.operator + and request.plan.descriptor.direction == domain.Direction.FORWARD + then + host:set_operator_inclusive(true) + end host:apply_cursor(outcome.endpoint) end if not outcome.complete then -- cgit v1.2.3