fix(ui): don't treat suspended as headless. Closes #1626

This commit is contained in:
Folke Lemaitre 2024-07-08 07:28:02 +02:00
parent 44cd12fa27
commit 2dfccd7b94
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 9 additions and 2 deletions

View File

@ -253,9 +253,10 @@ M.mapleader = nil
---@type string
M.maplocalleader = nil
local headless = #vim.api.nvim_list_uis() == 0
M.suspended = false
function M.headless()
return headless
return not M.suspended and #vim.api.nvim_list_uis() == 0
end
---@param opts? LazyConfig
@ -338,6 +339,12 @@ function M.setup(opts)
end
end,
})
vim.api.nvim_create_autocmd({ "VimSuspend", "VimResume" }, {
callback = function(ev)
M.suspended = ev.event == "VimSuspend"
end,
})
end,
})
end