Skip to content

Commit

Permalink
fix: stop processing messages when Neovim is exiting. Fixes #237
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Dec 3, 2022
1 parent 8d80a69 commit 8c8acf7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 0 additions & 7 deletions lua/noice/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ function M.setup(opts)
require("noice.commands").setup()
require("noice.message.router").setup()
M.enable()
vim.api.nvim_create_autocmd("VimLeavePre", {
callback = function()
if Config.is_running() then
pcall(M.disable)
end
end,
})
end)
end

Expand Down
4 changes: 4 additions & 0 deletions lua/noice/message/router.lua
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ function M.get_views()
end

function M.update()
if vim.v.exiting ~= vim.NIL then
return
end

if M._updating then
return
end
Expand Down

0 comments on commit 8c8acf7

Please sign in to comment.