Skip to content

Commit

Permalink
fix(ui): don't treat suspended as headless. Closes #1626
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jul 8, 2024
1 parent 44cd12f commit 2dfccd7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lua/lazy/core/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2dfccd7

Please sign in to comment.