summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:34:32 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:34:32 +0200
commit97dd567a7847e6efb7974a000353ecf4c44e1519 (patch)
tree02b31760abd828a0bfa1d641cc45a5d23b158589 /tests/run.lua
parent44682cf3244b773c33037967bd028608eb7be6dd (diff)
Create persistent character overlay
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua29
1 files changed, 28 insertions, 1 deletions
diff --git a/tests/run.lua b/tests/run.lua
index a03556f..7cb848c 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -4953,7 +4953,7 @@ end)
test("Interactive acquisition redraws after cursor marker creation", function()
fresh_sequence_state()
local host = MemoryHost.new({
- configuration = { mark_cursor = true },
+ configuration = { mark_cursor = true, mark_char = false },
input_packets = { { kind = "text", text = "a" } },
})
local service = acquisition_service.new(host)
@@ -4997,6 +4997,7 @@ test("Interactive acquisition creates enabled direct previews", function()
configuration = {
mark_cursor = false,
mark_direct = true,
+ mark_char = false,
ignore_case = false,
smart_case = false,
},
@@ -5956,6 +5957,32 @@ test("Persistent match starts stay on the anchor line", function()
same(domain.Position.new(2, 3), persistent.positions[2])
end)
+test("Persistent matches share one high-priority character overlay", function()
+ local state, transitions = fresh_sequence_state()
+ local host = MemoryHost.new({ buffer_lines = { "ababa" } })
+ local feedback = feedback_service.new({
+ host = host,
+ transitions = transitions,
+ })
+ local shared_target = target_plan.build(target("a"), matching_policy())
+ local movement = motion_plan.build(shared_target, "f")
+ local persistent = feedback:request_persistent({
+ context = "n",
+ anchor = domain.Position.new(1, 1),
+ target_plan = shared_target,
+ motion_plan = movement,
+ window = "window-1",
+ })
+ local highlight = host:highlights()[persistent.identity]
+
+ same("CleverFChar", highlight.group)
+ same(feedback_service.Priority.HIGH, highlight.priority)
+ same(shared_target, highlight.target_plan)
+ same(3, #highlight.positions)
+ list_same({ persistent.identity }, state:target_overlay_identities())
+ same(1, map_size(host:highlights()))
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then