Skip to content

Commit

Permalink
feat(lockfile): Fire PackerLockfileDone autocmd
Browse files Browse the repository at this point in the history
  • Loading branch information
EdenEast committed Nov 28, 2022
1 parent 15feddf commit 191d37b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ require knowing when the operations are complete, you can use the following `Use

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

### Using a floating window
You can configure Packer to use a floating window for command outputs by passing a utility
Expand Down
1 change: 1 addition & 0 deletions doc/packer.txt
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ use):
`PackerComplete` Fires after install, update, clean, and sync
asynchronous operations finish.
`PackerCompileDone` Fires after compiling (see |packer-lazy-load|)
`PackerLockfileDone` Fires after lockfile (see |packer-lockfile|)

==============================================================================
API *packer-api*
Expand Down
9 changes: 8 additions & 1 deletion lua/packer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,13 @@ packer.on_compile_done = function()
log.debug 'packer.compile: Complete'
end

packer.on_lockfile_done = function()
local log = require_and_configure 'log'

vim.cmd [[doautocmd User PackerLockfileDone]]
log.debug 'packer.lockfile: Complete'
end

--- Clean operation:
-- Finds plugins present in the `packer` package but not in the managed set
packer.clean = function(results)
Expand Down Expand Up @@ -766,7 +773,7 @@ packer.lockfile = function(...)
log.error(err)
end)

packer.on_complete()
packer.on_lockfile_done()
end)()
end

Expand Down

0 comments on commit 191d37b

Please sign in to comment.