aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/dot_config/nvim
diff options
context:
space:
mode:
authorLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-13 13:43:09 +0100
committerLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-13 13:43:09 +0100
commite83d5d1ef9476544e8843cc643c48f71c656375c (patch)
tree28d4a74fdf77f757d93e05da675ed1279ce036e0 /dot_config/nvim
parent9ad73cc8504fb836bde7ded6a6c62669174b4c7c (diff)
downloaddotfiles-e83d5d1ef9476544e8843cc643c48f71c656375c.tar.gz
dotfiles-e83d5d1ef9476544e8843cc643c48f71c656375c.tar.bz2
dotfiles-e83d5d1ef9476544e8843cc643c48f71c656375c.zip
refactor(nvim): simplify PackUpdate — vim.pack.update is effectively sync
It drives its async git ops with internal vim.wait and makes the confirm buffer current before returning. No need for a FileType autocmd: just write the buffer if the filetype matches (guards the 'Nothing to update' case where no buffer is created).
Diffstat (limited to 'dot_config/nvim')
-rw-r--r--dot_config/nvim/lua/config/pack.lua16
1 files changed, 3 insertions, 13 deletions
diff --git a/dot_config/nvim/lua/config/pack.lua b/dot_config/nvim/lua/config/pack.lua
index 9e00947..6573416 100644
--- a/dot_config/nvim/lua/config/pack.lua
+++ b/dot_config/nvim/lua/config/pack.lua
@@ -22,20 +22,10 @@ local function clean()
end
local function update()
- vim.api.nvim_create_autocmd("FileType", {
- pattern = "nvim-pack",
- once = true,
- callback = function(args)
- vim.schedule(function()
- if vim.api.nvim_buf_is_valid(args.buf) then
- vim.api.nvim_buf_call(args.buf, function()
- vim.cmd("silent write")
- end)
- end
- end)
- end,
- })
vim.pack.update()
+ if vim.bo.filetype == "nvim-pack" then
+ vim.cmd("silent write")
+ end
end
local function list()