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.
This commit is contained in:
Evgeni Chasnovski
2025-12-28 18:07:32 +02:00
parent f5707a9c42
commit c339b83a4a
4 changed files with 31 additions and 5 deletions

View File

@@ -25,8 +25,10 @@ for i, l in ipairs(lines) do
cur_header_hl_group = header_hl_groups[cur_group]
hi_range(i, 0, l:len(), cur_header_hl_group)
elseif l:find('^## (.+)$') ~= nil then
-- Header 2
-- Header 2 with possibly "(not active)" suffix
hi_range(i, 0, l:len(), cur_header_hl_group)
local col = l:match('() %(not active%)$') or l:len()
hi_range(i, col, l:len(), 'DiagnosticError', priority + 1)
elseif cur_info ~= nil then
-- Plugin info
local end_col = l:match('(). +%b()$') or l:len()