aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/health.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2024-09-26 07:45:03 -0700
committerGitHub <noreply@github.com>2024-09-26 07:45:03 -0700
commitf2fa4ca97ea3812dba78820323a1ccbf58921b40 (patch)
tree5e5e90585b06a4b774658da9b09307918c595418 /runtime/lua/vim/health.lua
parentefcfcb1efce04aeef85c69a9337f96ec76e78043 (diff)
downloadrneovim-f2fa4ca97ea3812dba78820323a1ccbf58921b40.tar.gz
rneovim-f2fa4ca97ea3812dba78820323a1ccbf58921b40.tar.bz2
rneovim-f2fa4ca97ea3812dba78820323a1ccbf58921b40.zip
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!
Diffstat (limited to 'runtime/lua/vim/health.lua')
-rw-r--r--runtime/lua/vim/health.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/runtime/lua/vim/health.lua b/runtime/lua/vim/health.lua
index f260d44b50..52a7a13966 100644
--- a/runtime/lua/vim/health.lua
+++ b/runtime/lua/vim/health.lua
@@ -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[]