File tree 4 files changed +39
-6
lines changed
4 files changed +39
-6
lines changed Original file line number Diff line number Diff line change @@ -519,6 +519,18 @@ require("lualine").setup({
519
519
520
520
</details >
521
521
522
+ ### 📆 User Events
523
+
524
+ The following user events will be triggered:
525
+
526
+ - ** LazyDone** : when lazy has finished starting up and loaded your config
527
+ - ** LazySync** : after running sync
528
+ - ** LazyInstall** : after an install
529
+ - ** LazyUpdate** : after an update
530
+ - ** LazyClean** : after a clean
531
+ - ** LazyCheck** : after checking for updates
532
+ - ** LazyLog** : after running log
533
+
522
534
## 🔒 Lockfile ` lazy-lock.json `
523
535
524
536
After every ** update** , the local lockfile is updated with the installed revisions.
Original file line number Diff line number Diff line change 45
45
- [ ] package meta index (package.lua cache for all packages)
46
46
47
47
- [ ] document highlight groups
48
- - [ ] document user events
48
+ - [x ] document user events
49
49
- [ ] document API, like lazy.plugins()
50
50
- [ ] icons
51
51
Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ function M.run(ropts, opts)
48
48
vim .cmd ([[ do User LazyRender]] )
49
49
Plugin .update_state ()
50
50
require (" lazy.manage.checker" ).fast_check ({ report = false })
51
+ local mode = opts .mode
52
+ if mode then
53
+ vim .cmd (" do User Lazy" .. mode :sub (1 , 1 ):upper () .. mode :sub (2 ))
54
+ end
51
55
end )
52
56
53
57
if opts .wait then
@@ -141,14 +145,27 @@ end
141
145
142
146
--- @param opts ? ManagerOpts
143
147
function M .sync (opts )
144
- opts = M .opts (opts , { mode = " sync " } )
148
+ opts = M .opts (opts )
145
149
if opts .clear then
146
150
M .clear ()
147
151
opts .clear = false
148
152
end
149
- M .clean (opts )
150
- M .install (opts )
151
- M .update (opts )
153
+ if opts .show ~= false then
154
+ vim .schedule (function ()
155
+ require (" lazy.view" ).show (" sync" )
156
+ end )
157
+ opts .show = false
158
+ end
159
+ local clean = M .clean (opts )
160
+ local install = M .install (opts )
161
+ local update = M .update (opts )
162
+ clean :wait (function ()
163
+ install :wait (function ()
164
+ update :wait (function ()
165
+ vim .cmd ([[ do User LazySync]] )
166
+ end )
167
+ end )
168
+ end )
152
169
end
153
170
154
171
--- @param opts ? ManagerOpts
Original file line number Diff line number Diff line change 139
139
--- @param cb ? fun ()
140
140
function Runner :wait (cb )
141
141
if # self ._running == 0 then
142
- return cb and cb ()
142
+ if cb then
143
+ cb ()
144
+ end
145
+ return self
143
146
end
144
147
145
148
if cb then
@@ -150,6 +153,7 @@ function Runner:wait(cb)
150
153
vim .wait (10 )
151
154
end
152
155
end
156
+ return self
153
157
end
154
158
155
159
return Runner
You can’t perform that action at this time.
0 commit comments