range: extmarks/tsquery; renderer: text-change
All checks were successful
NeoVim tests / code-quality (push) Successful in 1m18s

This commit is contained in:
2025-06-11 20:04:46 -06:00
parent 12945a4cdf
commit 72b6886838
25 changed files with 1371 additions and 224 deletions

View File

@@ -22,7 +22,7 @@ vim.api.nvim_create_autocmd('VimResized', {
end,
})
--- @alias u.example.Notification {
--- @alias u.examples.Notification {
--- kind: number;
--- id: number;
--- text: string;
@@ -31,7 +31,7 @@ vim.api.nvim_create_autocmd('VimResized', {
local M = {}
--- @type { win: integer, buf: integer, renderer: u.Renderer } | nil
--- @type { win: integer, buf: integer, renderer: u.renderer.Renderer } | nil
local notifs_w
local s_notifications_raw = tracker.create_signal {}
@@ -39,7 +39,7 @@ local s_notifications = s_notifications_raw:debounce(50)
-- Render effect:
tracker.create_effect(function()
--- @type u.example.Notification[]
--- @type u.examples.Notification[]
local notifs = s_notifications:get()
--- @type { width: integer, height: integer }
local editor_size = S_EDITOR_DIMENSIONS:get()
@@ -105,7 +105,7 @@ end)
--- @param id number
local function _delete_notif(id)
--- @param notifs u.example.Notification[]
--- @param notifs u.examples.Notification[]
s_notifications_raw:schedule_update(function(notifs)
for i, notif in ipairs(notifs) do
if notif.id == id then
@@ -130,7 +130,7 @@ function M.notify(msg, level, opts)
opts = opts or {}
local id = opts.id or math.random(999999999)
--- @type u.example.Notification?
--- @type u.examples.Notification?
local notif = vim.iter(s_notifications_raw:get()):find(function(n) return n.id == id end)
if not notif then
-- Create a new notification (maybe):
@@ -145,7 +145,7 @@ function M.notify(msg, level, opts)
text = msg,
timer = timer,
}
--- @param notifs u.example.Notification[]
--- @param notifs u.examples.Notification[]
s_notifications_raw:schedule_update(function(notifs)
table.insert(notifs, notif)
return notifs