summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua25
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