Skip to content

Commit

Permalink
fix: deal with E11 errors when the cmdline-window is open #4
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 3, 2022
1 parent c8dc8b5 commit 8aa5efd
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lua/noice/view/nui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ local require = require("noice.util.lazy")

local View = require("noice.view")
local Event = require("nui.utils.autocmd").event
local Util = require("noice.util")

---@class NuiRelative
---@field type "'cursor'"|"'editor'"|"'win'"
Expand Down Expand Up @@ -88,8 +89,18 @@ end

function NuiView:hide()
if self._nui then
self._nui:hide()
self._visible = false

Util.protect(function()
if not self._visible then
self._nui:hide()
end
end, {
finally = function()
self._nui._.loading = false
end,
retry_on_E11 = true,
})()
end
end

Expand Down

0 comments on commit 8aa5efd

Please sign in to comment.