From 0668744a8f18edd1da4914f901bf6f108ab2fd81 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 10:52:25 +0200 Subject: Toggle forward operator inclusivity --- tests/run.lua | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'tests') diff --git a/tests/run.lua b/tests/run.lua index 2595224..393d51a 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -3500,6 +3500,43 @@ test("Visual execution preserves command direction and feedback anchor", functio same(domain.Position.new(2, 1), state:get_previous_landing("v")) end) +test("Forward operator motions toggle characterwise inclusivity", function() + for _, descriptor in ipairs({ "f", "t" }) do + fresh_sequence_state() + local host = MemoryHost.new({ + buffer_lines = { "hoge fuge" }, + cursor = { line = 1, byte_column = 1 }, + mode = "no", + pending_operator = "delete", + }) + local plan = motion_plan.build( + target_plan.build(target("e"), matching_policy()), + descriptor + ) + local view = text_topology.from_host(host) + host:clear_operations() + local outcome = motion_executor.new(host):execute( + view, + "no", + plan, + 1, + true + ) + + same(domain.ActionKind.MOVEMENT, outcome.kind, descriptor) + truthy(host:operator_inclusive(), descriptor) + local effect_operations = {} + for _, operation in ipairs(host:operations()) do + if operation.operation == "set_operator_inclusive" + or operation.operation == "apply_cursor" + then + effect_operations[#effect_operations + 1] = operation.operation + end + end + list_same({ "set_operator_inclusive", "apply_cursor" }, effect_operations) + end +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then -- cgit v1.2.3