From c339b83a4ab99d170776b01c4e4ca4e550f45bba Mon Sep 17 00:00:00 2001 From: Evgeni Chasnovski Date: Sun, 28 Dec 2025 18:07:32 +0200 Subject: feat(pack): hint in confirmation buffer that plugin is not active Problem: After `vim.pack.update()` it is not clear if plugin is active or not. This can be useful to detect cases when plugin was removed from 'init.lua' but there was no `vim.pack.del()`. Solution: Add ` (not active)` suffix with distinctive highlighting to header of plugins that are not active. It will also be shown in in-process LSP document symbols to have quick reference about which plugins are not active. --- test/functional/plugin/pack_spec.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test/functional/plugin/pack_spec.lua') diff --git a/test/functional/plugin/pack_spec.lua b/test/functional/plugin/pack_spec.lua index c9a8b21b5c..6267a85904 100644 --- a/test/functional/plugin/pack_spec.lua +++ b/test/functional/plugin/pack_spec.lua @@ -1622,6 +1622,29 @@ describe('vim.pack', function() ref_fetch_lock.rev = git_get_hash('main', 'fetch') eq(ref_fetch_lock, get_lock_tbl().plugins.fetch) end) + + it('hints about not active plugins', function() + exec_lua(function() + vim.pack.update() + end) + + for _, l in ipairs(api.nvim_buf_get_lines(0, 0, -1, false)) do + if l:match('^## ') then + matches(' %(not active%)$', l) + end + end + + -- Should also hint in `textDocument/documentSymbol` of in-process LSP, + -- yet still work for navigation + exec_lua('vim.lsp.buf.document_symbol()') + local loclist = fn.getloclist(0) + matches(' %(not active%)$', loclist[2].text) + matches(' %(not active%)$', loclist[4].text) + matches(' %(not active%)$', loclist[5].text) + + n.exec('llast') + eq(21, api.nvim_win_get_cursor(0)[1]) + end) end) it('works with not active plugins', function() -- cgit