fix(progress): show progress-status only in curwin #38458

Problem:
Currently same progress stat get's displayed on statusline of all
windows. This is repeatitive and noisy.

Solultion:
Only display progress-status on the focused window

Problem:
Currently, when multiple progress are on going we show it as Progress:
{N} items {percent}% format. It can be simplified sinnce items doesn't
really add enough value for the valuable space it takes in statusline

Solution:
Change format to Progress: {percent}%({N})
This commit is contained in:
Shadman
2026-03-24 18:28:44 +06:00
committed by GitHub
parent 10ca09a2cb
commit 0af01948f3
4 changed files with 29 additions and 6 deletions

View File

@@ -352,7 +352,7 @@ do
--- Gets a status description summarizing currently running progress messages.
--- - If none: returns empty string
--- - If one running item: "title: 42%"
--- - If multiple running items: "Progress: N items AVG%"
--- - If multiple running items: "Progress: AVG%(N)"
---@param running ProgressMessage[]
---@return string
local function progress_status_fmt(running)
@@ -371,7 +371,7 @@ do
sum = sum + (progress_item.percent or 0)
end
local avg = math.floor(sum / count)
return string.format('Progress: %d items %d%%%% ', count, avg)
return string.format('Progress: %d%%%%(%d) ', avg, count)
end
end