feat(health): highlight headings #30525

Problem:
checkhealth report sections are not visually separated.

Solution:
Highlight with "reverse".

TODO: migrate checkhealth filetype to use treesitter.
TODO: default :help should also highlight headings more boldy!
This commit is contained in:
Justin M. Keyes
2024-09-26 07:45:03 -07:00
committed by GitHub
parent efcfcb1efc
commit f2fa4ca97e
3 changed files with 48 additions and 35 deletions

View File

@@ -379,7 +379,14 @@ function M._check(mods, plugin_names)
s_output = {}
M.error('The healthcheck report for "' .. name .. '" plugin is empty.')
end
local header = { string.rep('=', 78), name .. ': ' .. func, '' }
local header = {
string.rep('=', 78),
-- Example: `foo.health: [ …] require("foo.health").check()`
('%s: %s%s'):format(name, (' '):rep(76 - name:len() - func:len()), func),
'',
}
-- remove empty line after header from report_start
if s_output[1] == '' then
local tmp = {} ---@type string[]