Skip to content

Commit

Permalink
fix: dont render views when not running. Fixes #200
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Nov 7, 2022
1 parent 412594c commit 9dc2508
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lua/noice/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function M.setup(opts)
require("noice.commands").setup()
require("noice.message.router").setup()
M.enable()
vim.api.nvim_create_autocmd("VimLeave", {
vim.api.nvim_create_autocmd("VimLeavePre", {
callback = function()
if Config.is_running() then
pcall(M.disable)
Expand Down
3 changes: 3 additions & 0 deletions lua/noice/view/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ end
---@param buf number buffer number
---@param opts? {offset: number, highlight: boolean, messages?: NoiceMessage[]} line number (1-indexed), if `highlight`, then only highlight
function View:render(buf, opts)
if not Config.is_running() then
return
end
opts = opts or {}
local linenr = opts.offset or 1

Expand Down

0 comments on commit 9dc2508

Please sign in to comment.