summaryrefslogtreecommitdiff
path: root/lua/clever_f
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 10:52:25 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 10:52:25 +0200
commit0668744a8f18edd1da4914f901bf6f108ab2fd81 (patch)
tree724fdf2452718a9e96dad11dea9d0aaf8956e542 /lua/clever_f
parent7c145a7e7369a2f02f32383603186ca1471794c0 (diff)
Toggle forward operator inclusivity
Diffstat (limited to 'lua/clever_f')
-rw-r--r--lua/clever_f/motion_executor.lua6
1 files changed, 6 insertions, 0 deletions
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