diff options
| -rw-r--r-- | lua/clever_f/feedback_service.lua | 1 | ||||
| -rw-r--r-- | tests/run.lua | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/lua/clever_f/feedback_service.lua b/lua/clever_f/feedback_service.lua index 037c7fd..9c16cca 100644 --- a/lua/clever_f/feedback_service.lua +++ b/lua/clever_f/feedback_service.lua @@ -413,6 +413,7 @@ function FeedbackService:build_persistent(specification) motion_plan = specification.motion_plan, descriptor = descriptor, endpoint_policy = endpoint_policy, + match_start_line = anchor.line, positions = M.persistent_match_positions( view, anchor.line, diff --git a/tests/run.lua b/tests/run.lua index b044379..444a310 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -5933,6 +5933,26 @@ test("Persistent positions apply target predicates and endpoint transforms", fun ) end) +test("Persistent match starts stay on the anchor line", function() + fresh_sequence_state() + local host = MemoryHost.new({ buffer_lines = { "axa", "aya", "aza" } }) + local feedback = feedback_service.new(host) + local shared_target = target_plan.build(target("a"), matching_policy()) + local movement = motion_plan.build(shared_target, "f") + local persistent = feedback:build_persistent({ + context = "n", + anchor = domain.Position.new(2, 2), + target_plan = shared_target, + motion_plan = movement, + window = "window-1", + }) + + same(2, persistent.match_start_line) + same(2, #persistent.positions) + same(domain.Position.new(2, 1), persistent.positions[1]) + same(domain.Position.new(2, 3), persistent.positions[2]) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then |
