summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/clever_f/destination_engine.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/lua/clever_f/destination_engine.lua b/lua/clever_f/destination_engine.lua
index 2ff4c7a..e0ddcca 100644
--- a/lua/clever_f/destination_engine.lua
+++ b/lua/clever_f/destination_engine.lua
@@ -82,13 +82,25 @@ local function next_matching_start(request, origin)
end
end
+local function regular_destination(request, target_position)
+ if request.plan.descriptor.family == domain.Family.FIND then
+ return target_position
+ end
+ return target_position
+end
+
+local function target_destination(request, target_position)
+ return regular_destination(request, target_position)
+end
+
function DestinationEngine:calculate(view, origin, plan, count, first_move)
local request = calculation_inputs(view, origin, plan, count, first_move)
local target_position = next_matching_start(request, request.origin)
if target_position == nil then
return domain.SearchOutcome.boundary_before_any(request.origin)
end
- return domain.SearchOutcome.complete(target_position, 1)
+ local destination = target_destination(request, target_position)
+ return domain.SearchOutcome.complete(destination, 1)
end
function M.new()