Skip to content

Commit

Permalink
fix: reset view when update_layout fails. Fixes #155
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Nov 20, 2022
1 parent 4757fd9 commit 7d08ed5
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 @@ -174,7 +174,11 @@ function NuiView:reset(old, new)
self._nui = nil
self._visible = false
elseif layout then
self:update_layout()
if not pcall(self.update_layout, self) then
self._nui:unmount()
self._nui = nil
self._visible = false
end
end
end
end
Expand Down

0 comments on commit 7d08ed5

Please sign in to comment.