diff options
| author | Evgeni Chasnovski <evgeni.chasnovski@gmail.com> | 2025-12-28 18:07:32 +0200 |
|---|---|---|
| committer | Evgeni Chasnovski <evgeni.chasnovski@gmail.com> | 2025-12-28 18:39:26 +0200 |
| commit | c339b83a4ab99d170776b01c4e4ca4e550f45bba (patch) | |
| tree | 0318ee32fd6a248e143e21cb2165b442efbad6ef /test/functional/plugin/pack_spec.lua | |
| parent | f5707a9c42a6f0efd0d7abaa1e5caf62eab21aea (diff) | |
| download | rneovim-c339b83a4ab99d170776b01c4e4ca4e550f45bba.tar.gz rneovim-c339b83a4ab99d170776b01c4e4ca4e550f45bba.tar.bz2 rneovim-c339b83a4ab99d170776b01c4e4ca4e550f45bba.zip | |
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.
Diffstat (limited to 'test/functional/plugin/pack_spec.lua')
| -rw-r--r-- | test/functional/plugin/pack_spec.lua | 23 |
1 files changed, 23 insertions, 0 deletions
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() |