@@ -42,17 +42,16 @@ local spinners = {
42
42
--- @private
43
43
function spinner :spin ()
44
44
local stype = self .spinner
45
+ if not stype then return end
45
46
46
- if stype then
47
- self :set (nil , nil , {
48
- icon = stype .frames [self .index + 1 ],
49
- })
47
+ self :set (nil , nil , {
48
+ icon = stype .frames [self .index + 1 ],
49
+ })
50
50
51
- self .index = (self .index + 1 ) % # stype .frames
51
+ self .index = (self .index + 1 ) % # stype .frames
52
52
53
- local fps = 1000 / # stype .frames
54
- vim .defer_fn (function () self :spin () end , fps )
55
- end
53
+ local fps = 1000 / # stype .frames
54
+ vim .defer_fn (function () self :spin () end , fps )
56
55
end
57
56
58
57
--- @private
@@ -64,10 +63,11 @@ function spinner:set(msg, lvl, opts)
64
63
if msg then self :update (msg ) end
65
64
lvl = lvl or vim .log .levels .INFO
66
65
67
- opts = vim .tbl_deep_extend (" force" , self . noti and { replace = self . noti } or {}, {
66
+ opts = vim .tbl_deep_extend (" force" , {
68
67
hide_from_history = true ,
69
68
title = config .name ,
70
69
timeout = false ,
70
+ replace = self .noti ,
71
71
}, opts or {})
72
72
73
73
self .noti = vim .notify (self .msg , lvl , opts )
@@ -92,7 +92,7 @@ function spinner:stop(msg, success, opts)
92
92
93
93
opts = vim .tbl_deep_extend (" force" , {
94
94
icon = success and " " or " " ,
95
- timeout = 2000 ,
95
+ timeout = 1500 ,
96
96
}, opts or {})
97
97
98
98
self .spinner = nil
0 commit comments