mirror of
https://github.com/neovim/neovim.git
synced 2026-06-17 09:11:21 +00:00
backport docs: misc (#39206)
docs: misc
(cherry picked from commit 54398c5874)
This commit is contained in:
@@ -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 (0–100)
|
||||
---@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
|
||||
|
||||
Reference in New Issue
Block a user