Skip to content

Commit 08790b3

Browse files
EdenEastJames Simpson
authored and
James Simpson
committed
feat(lockfile): Fire PackerLockfileDone autocmd
1 parent 9797215 commit 08790b3

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ require knowing when the operations are complete, you can use the following `Use
615615

616616
- `PackerComplete`: Fires after install, update, clean, and sync asynchronous operations finish.
617617
- `PackerCompileDone`: Fires after compiling (see [the section on compilation](#compiling-lazy-loaders))
618+
- `PackerLockfileDone`: Fires after lockfile generation (see [the section on lockfile](#lockfile))
618619

619620
### Using a floating window
620621
You can configure Packer to use a floating window for command outputs by passing a utility

doc/packer.txt

+1
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ use):
563563
`PackerComplete` Fires after install, update, clean, and sync
564564
asynchronous operations finish.
565565
`PackerCompileDone` Fires after compiling (see |packer-lazy-load|)
566+
`PackerLockfileDone` Fires after lockfile (see |packer-lockfile|)
566567

567568
==============================================================================
568569
API *packer-api*

lua/packer.lua

+8-1
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,13 @@ packer.on_compile_done = function()
431431
log.debug 'packer.compile: Complete'
432432
end
433433

434+
packer.on_lockfile_done = function()
435+
local log = require_and_configure 'log'
436+
437+
vim.cmd [[doautocmd User PackerLockfileDone]]
438+
log.debug 'packer.lockfile: Complete'
439+
end
440+
434441
--- Clean operation:
435442
-- Finds plugins present in the `packer` package but not in the managed set
436443
packer.clean = function(results)
@@ -766,7 +773,7 @@ packer.lockfile = function(...)
766773
log.error(err)
767774
end)
768775

769-
packer.on_complete()
776+
packer.on_lockfile_done()
770777
end)()
771778
end
772779

0 commit comments

Comments
 (0)