From ce063ff1737aba8a2da2c2644e03517dd1a318c8 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 11:38:40 +0200 Subject: Create exact cursor marker --- tests/run.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'tests/run.lua') diff --git a/tests/run.lua b/tests/run.lua index 1a3536f..1bd0c64 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -4432,6 +4432,31 @@ test("Direct overlays use ordinary priority", function() ) end) +test("Cursor marker overlays the exact cursor byte position", function() + local state, transitions = fresh_sequence_state() + local host = MemoryHost.new({ + buffer_lines = { "a\227\129\130b" }, + cursor = { line = 1, byte_column = 5 }, + }) + local feedback = feedback_service.new({ + host = host, + transitions = transitions, + }) + local cursor = host:read_cursor() + + local marker = feedback:create_cursor_marker(cursor, "window-1") + local highlight = host:highlights()[marker.identity] + same("CleverFCursor", highlight.group) + same("window-1", highlight.window) + same(domain.Position.new(1, 5), highlight.position) + same(feedback_service.Priority.HIGH, highlight.priority) + same(marker.identity, state:temporary_overlay_identities()[1]) + + truthy(feedback:remove_temporary_overlay(marker)) + same(nil, host:highlights()[marker.identity]) + same(0, #state:temporary_overlay_identities()) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then -- cgit v1.2.3