aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin/python.vim
diff options
context:
space:
mode:
authorEvgeni Chasnovski <evgeni.chasnovski@gmail.com>2025-12-26 17:35:25 +0200
committerEvgeni Chasnovski <evgeni.chasnovski@gmail.com>2025-12-26 18:32:59 +0200
commit8c28507fcf6fa5e39adba2a7f9dc07442aa3bbeb (patch)
tree72cb0cae91820689107b41b47f45a775ddc190a1 /runtime/ftplugin/python.vim
parent899ec829be85b52202f0ce32c455ae4f4d60b85b (diff)
downloadrneovim-8c28507fcf6fa5e39adba2a7f9dc07442aa3bbeb.tar.gz
rneovim-8c28507fcf6fa5e39adba2a7f9dc07442aa3bbeb.tar.bz2
rneovim-8c28507fcf6fa5e39adba2a7f9dc07442aa3bbeb.zip
feat(pack): allow choosing update target in `update()`
Problem: There are two fairly common workflows that involve lockfile and can be made more straightforward in `vim.pack`: 1. Revert latest update. Like if it introduced unwanted behavior. 2. Update to a revision in the lockfile. Like if already updated on another machine, verified that everything works, `git add` + `git commit` + `git push` the config, and want to have the same plugin states on current machine. Solution: Make `update` allow `opts.target`. By default it uses `version` from a plugin specification (like a regular "get new changes from source" workflow). But it also allows `"lockfile"` value to indicate that target revision after update should be taken from the current lockfile verbatim. With this, the workflows are: 1. Revert (somehow) to the lockfile before the update, restart, and `vim.pack.update({ 'plugin' }, { target = 'lockfile' })`. If Git tracked, revert with `git checkout HEAD -- nvim-pack-lock.json`. For non-VCS tracked lockfile, the revisions can be taken from the log file. It would be nicer if `update()` would backup a lockfile before doing an update, but that might require discussions. 2. `git pull` + `:restart` + `vim.pack.update(nil, { target = 'lockfile' })`. The only caveats are for new and deleted plugins: - New plugins (not present locally but present in the lockfile) will be installed at lockfile revision during restart. - Deleted plugins (present locally but not present in the lockfile) will still be present: both locally *and* in the lockfile. They can be located by `git diff -- nvim-pack-lock.json` and require manual `vim.pack.del({ 'old-plugin1', 'old-plugin2' })`.
Diffstat (limited to 'runtime/ftplugin/python.vim')
0 files changed, 0 insertions, 0 deletions