Skip to content

Commit 6b9144d

Browse files
committed
feat: don't hide mini messages when blocking #112
1 parent e76af89 commit 6b9144d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lua/noice/view/backend/mini.lua

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ local require = require("noice.util.lazy")
22

33
local View = require("noice.view")
44
local NuiView = require("noice.view.nui")
5+
local Util = require("noice.util")
56

67
---@class NoiceMiniOptions
78
---@field timeout integer
@@ -32,12 +33,19 @@ function MiniView:update_options()
3233
self._opts = vim.tbl_deep_extend("force", defaults, self._opts)
3334
end
3435

36+
function MiniView:can_hide()
37+
return not Util.is_blocking()
38+
end
39+
3540
-- TODO: add keep() method. Stay open by default during blocking event and on mouse enter
3641
function MiniView:autohide(id)
3742
if not self.timers[id] then
3843
self.timers[id] = vim.loop.new_timer()
3944
end
4045
self.timers[id]:start(self._opts.timeout, 0, function()
46+
if not self:can_hide() then
47+
return self:autohide(id)
48+
end
4149
self.active[id] = nil
4250
self.timers[id] = nil
4351
vim.schedule(function()

0 commit comments

Comments
 (0)