Skip to content

Commit

Permalink
fix(nui): mount if buffer is no longer valid
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jan 15, 2023
1 parent e8f0cdc commit 71d7b5c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/noice/view/nui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ function NuiView:update_layout()
self._nui:update_layout(self:get_layout())
end

function NuiView:is_mounted()
return self._nui and self._nui._.mounted and self._nui.bufnr and vim.api.nvim_buf_is_valid(self._nui.bufnr)
end

function NuiView:show()
if self._loading then
return
Expand All @@ -266,7 +270,7 @@ function NuiView:show()
self:create()
end

if not self._nui._.mounted then
if not self:is_mounted() then
self:mount()
end

Expand Down

0 comments on commit 71d7b5c

Please sign in to comment.