backport docs: misc (#39206)

docs: misc


(cherry picked from commit 54398c5874)
This commit is contained in:
Justin M. Keyes
2026-04-19 08:36:19 -04:00
committed by GitHub
parent 15991abaa7
commit 43398547ec
18 changed files with 387 additions and 246 deletions

View File

@@ -304,16 +304,9 @@ function M._get_urls()
end
do
---@class ProgressMessage
---@field id? number|string ID of the progress message
---@field title? string Title of the progress message
---@field status string Status: "running" | "success" | "failed" | "cancel"
---@field percent? integer Percent complete (0100)
---@private
--- Cache of active progress messages, keyed by msg_id
--- TODO(justinmk): visibility of "stale" (never-finished) Progress. https://github.com/neovim/neovim/pull/35428#discussion_r2942696157
---@type table<integer, ProgressMessage>
---@type table<integer, vim.event.progress.data>
local progress = {}
-- store progress events
@@ -325,7 +318,7 @@ do
progress_autocmd = vim.api.nvim_create_autocmd('Progress', {
group = progress_group,
desc = 'Tracks progress messages for vim.ui.progress_status()',
---@param ev {data: {id: integer, title: string, status: string, percent: integer}}
---@param ev {data: vim.event.progress.data}
callback = function(ev)
if not ev.data or not ev.data.id then
return
@@ -349,7 +342,7 @@ do
--- Gets a status description summarizing currently running progress messages.
--- - If none: returns empty string
--- - If N item running: "AVG%(N)"
---@param running ProgressMessage[]
---@param running vim.event.progress.data[]
---@return string
local function progress_status_fmt(running)
local count = #running