diff options
| author | Olivia Kinnear <git@superatomic.dev> | 2026-07-24 10:54:12 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-24 11:54:12 -0400 |
| commit | bb104ba4dba42eda89bae817264eee959df5bbf0 (patch) | |
| tree | 7952cd09cf0922545e4e0931a675b8af725b2174 /runtime/lua/vim | |
| parent | 20f44076dca00da3af2ce8b4fca8fd533f5b313a (diff) | |
| download | rneovim-bb104ba4dba42eda89bae817264eee959df5bbf0.tar.gz rneovim-bb104ba4dba42eda89bae817264eee959df5bbf0.tar.bz2 rneovim-bb104ba4dba42eda89bae817264eee959df5bbf0.zip | |
feat(health): improvements to :checkhealth #40935
Changes:
- Removed the blank line before the first healthcheck header.
- Fixed a bug where the entire "Terminal" section of `vim.health` would
not appear if the `infocmp` executable was not found.
- Fixed a typo in `vim.lsp` when displaying the LSP log level.
Diffstat (limited to 'runtime/lua/vim')
| -rw-r--r-- | runtime/lua/vim/health.lua | 5 | ||||
| -rw-r--r-- | runtime/lua/vim/health/health.lua | 15 | ||||
| -rw-r--r-- | runtime/lua/vim/lsp/health.lua | 2 |
3 files changed, 14 insertions, 8 deletions
diff --git a/runtime/lua/vim/health.lua b/runtime/lua/vim/health.lua index 432cf09cd9..331dca71f3 100644 --- a/runtime/lua/vim/health.lua +++ b/runtime/lua/vim/health.lua @@ -459,7 +459,6 @@ function M._check(eap) for _, name in ipairs(names) do local value = healthchecks[name] progress_msg('running', check_idx, 'checking %s', name) - check_idx = check_idx + 1 local func = value[1] local type = value[2] s_output = {} @@ -508,7 +507,9 @@ function M._check(eap) end s_output[#s_output + 1] = '' s_output = vim.list_extend(header, s_output) - vim.fn.append(vim.fn.line('$'), s_output) + vim.api.nvim_buf_set_lines(0, check_idx == 1 and 0 or -1, -1, true, s_output) + + check_idx = check_idx + 1 end progress_msg('success', nil, 'checks done') diff --git a/runtime/lua/vim/health/health.lua b/runtime/lua/vim/health/health.lua index 6ea239675b..cbdd254d98 100644 --- a/runtime/lua/vim/health/health.lua +++ b/runtime/lua/vim/health/health.lua @@ -486,15 +486,12 @@ local function check_graphics() end end -local function check_terminal() +-- Note: this is part of check_terminal(). +local function check_infocmp() if vim.fn.executable('infocmp') == 0 then return end - health.start('Terminal') - - check_graphics() - local cmd = { 'infocmp', '-L' } local ok, out = system(cmd) local kbs_entry = vim.fn.matchstr(out, 'key_backspace=[^,[:space:]]*') @@ -527,6 +524,14 @@ local function check_terminal() ) ) end +end + +local function check_terminal() + health.start('Terminal') + + check_graphics() + + check_infocmp() for _, env_var in ipairs({ 'XTERM_VERSION', diff --git a/runtime/lua/vim/lsp/health.lua b/runtime/lua/vim/lsp/health.lua index 19362c86d0..80f80217a1 100644 --- a/runtime/lua/vim/lsp/health.lua +++ b/runtime/lua/vim/lsp/health.lua @@ -24,7 +24,7 @@ local function check_log() local log = vim.lsp.log local current_log_level = log.get_level() local log_level_string = log.levels[current_log_level] ---@type string - report_info(string.format('LSP log level : %s', log_level_string)) + report_info(string.format('LSP log level: %s', log_level_string)) if current_log_level < log.levels.WARN then report_warn( |