mirror of
https://github.com/neovim/neovim.git
synced 2026-03-29 20:02:03 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user