diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:38:40 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:38:40 +0200 |
| commit | ce063ff1737aba8a2da2c2644e03517dd1a318c8 (patch) | |
| tree | 331113edbad182dd46b98f4ccc72e81083d0c82c /tests | |
| parent | e32d66c1bc77b149f49e96006e0b377789e8e9f9 (diff) | |
Create exact cursor marker
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run.lua | 25 |
1 files changed, 25 insertions, 0 deletions
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 |
