From e83d5d1ef9476544e8843cc643c48f71c656375c Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Wed, 13 May 2026 13:43:09 +0100 Subject: refactor(nvim): simplify PackUpdate — vim.pack.update is effectively sync MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). --- dot_config/nvim/lua/config/pack.lua | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'dot_config/nvim/lua') 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() -- cgit v1.3.1