File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ local require = require("noice.util.lazy")
2
2
3
3
local View = require (" noice.view" )
4
4
local NuiView = require (" noice.view.nui" )
5
+ local Util = require (" noice.util" )
5
6
6
7
--- @class NoiceMiniOptions
7
8
--- @field timeout integer
@@ -32,12 +33,19 @@ function MiniView:update_options()
32
33
self ._opts = vim .tbl_deep_extend (" force" , defaults , self ._opts )
33
34
end
34
35
36
+ function MiniView :can_hide ()
37
+ return not Util .is_blocking ()
38
+ end
39
+
35
40
-- TODO: add keep() method. Stay open by default during blocking event and on mouse enter
36
41
function MiniView :autohide (id )
37
42
if not self .timers [id ] then
38
43
self .timers [id ] = vim .loop .new_timer ()
39
44
end
40
45
self .timers [id ]:start (self ._opts .timeout , 0 , function ()
46
+ if not self :can_hide () then
47
+ return self :autohide (id )
48
+ end
41
49
self .active [id ] = nil
42
50
self .timers [id ] = nil
43
51
vim .schedule (function ()
You can’t perform that action at this time.
0 commit comments