Skip to content

Commit 2dfccd7

Browse files
committed
fix(ui): don't treat suspended as headless. Closes #1626
1 parent 44cd12f commit 2dfccd7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lua/lazy/core/config.lua

+9-2
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,10 @@ M.mapleader = nil
253253
---@type string
254254
M.maplocalleader = nil
255255

256-
local headless = #vim.api.nvim_list_uis() == 0
256+
M.suspended = false
257+
257258
function M.headless()
258-
return headless
259+
return not M.suspended and #vim.api.nvim_list_uis() == 0
259260
end
260261

261262
---@param opts? LazyConfig
@@ -338,6 +339,12 @@ function M.setup(opts)
338339
end
339340
end,
340341
})
342+
343+
vim.api.nvim_create_autocmd({ "VimSuspend", "VimResume" }, {
344+
callback = function(ev)
345+
M.suspended = ev.event == "VimSuspend"
346+
end,
347+
})
341348
end,
342349
})
343350
end

0 commit comments

Comments
 (0)