summaryrefslogtreecommitdiff
path: root/lua/clever_f
diff options
context:
space:
mode:
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