aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/pack.lua
diff options
context:
space:
mode:
authorAndrew Braxton <andrewcbraxton@gmail.com>2026-02-12 04:15:53 -0500
committerGitHub <noreply@github.com>2026-02-12 04:15:53 -0500
commit5468e6a452721f9d09ee459fedd200fef05a5eaa (patch)
tree37f9ba7d0dc65effb8f64606ddab22ef1ae8102e /runtime/lua/vim/pack.lua
parent6b4ec2264e1d8ba027b85f3883d532c5068be92a (diff)
downloadrneovim-5468e6a452721f9d09ee459fedd200fef05a5eaa.tar.gz
rneovim-5468e6a452721f9d09ee459fedd200fef05a5eaa.tar.bz2
rneovim-5468e6a452721f9d09ee459fedd200fef05a5eaa.zip
fix(pack): skip :redraw! if headless #37782
Otherwise, output will be concatenated without newlines. TODO: the ":redraw!" call can be dropped entirely after ui2 becomes the default.
Diffstat (limited to 'runtime/lua/vim/pack.lua')
-rw-r--r--runtime/lua/vim/pack.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/lua/vim/pack.lua b/runtime/lua/vim/pack.lua
index 801db5792b..3371f66c31 100644
--- a/runtime/lua/vim/pack.lua
+++ b/runtime/lua/vim/pack.lua
@@ -484,6 +484,7 @@ end
--- @return fun(kind: 'begin'|'report'|'end', percent: integer, fmt: string, ...:any): nil
local function new_progress_report(action)
local progress = { kind = 'progress', title = 'vim.pack' }
+ local headless = #api.nvim_list_uis() == 0
return vim.schedule_wrap(function(kind, percent, fmt, ...)
progress.status = kind == 'end' and 'success' or 'running'
@@ -491,7 +492,10 @@ local function new_progress_report(action)
local msg = ('%s %s'):format(action, fmt:format(...))
progress.id = api.nvim_echo({ { msg } }, kind ~= 'report', progress)
-- Force redraw to show installation progress during startup
- vim.cmd.redraw({ bang = true })
+ -- TODO: redraw! not needed with ui2.
+ if not headless then
+ vim.cmd.redraw({ bang = true })
+ end
end)
end