summaryrefslogtreecommitdiff
path: root/lua/clever_f/destination_engine.lua
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 10:22:02 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 10:22:02 +0200
commit80496b38064f1abde2b5870955bd73b7d3a3d794 (patch)
treed2f32e6d99501b1731fedf326c8ca53c7d1d3b1f /lua/clever_f/destination_engine.lua
parent1a9f90afcc6e5e00a94dd188a5361a894d06e257 (diff)
Adjust exclusive FIND destinations
Diffstat (limited to 'lua/clever_f/destination_engine.lua')
-rw-r--r--lua/clever_f/destination_engine.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/lua/clever_f/destination_engine.lua b/lua/clever_f/destination_engine.lua
index ed3b7b2..5e60736 100644
--- a/lua/clever_f/destination_engine.lua
+++ b/lua/clever_f/destination_engine.lua
@@ -94,6 +94,13 @@ local function regular_destination(request, target_position)
end
local function target_destination(request, target_position)
+ local descriptor = request.plan.descriptor
+ if request.plan.endpoint_policy == domain.EndpointPolicy.VISUAL_EXCLUSIVE
+ and descriptor.direction == domain.Direction.FORWARD
+ and descriptor.family == domain.Family.FIND
+ then
+ return request.view:successor(target_position)
+ end
return regular_destination(request, target_position)
end
@@ -104,6 +111,9 @@ function DestinationEngine:calculate(view, origin, plan, count, first_move)
return domain.SearchOutcome.boundary_before_any(request.origin)
end
local destination = target_destination(request, target_position)
+ if destination == nil then
+ return domain.SearchOutcome.boundary_before_any(request.origin)
+ end
return domain.SearchOutcome.complete(destination, 1)
end