diff options
author | dundargoc <gocdundar@gmail.com> | 2024-04-08 10:57:37 +0200 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2024-04-13 01:18:40 +0200 |
commit | 66220d164a40791a5131d4660e6ffbee431070d5 (patch) | |
tree | 103ee7f69e4672a94bdc860dcb1e1183d7f16da3 /runtime/lua/vim/health.lua | |
parent | 4f3d018d15d299b66a341bed4d677d7ec03ad44f (diff) | |
download | rneovim-66220d164a40791a5131d4660e6ffbee431070d5.tar.gz rneovim-66220d164a40791a5131d4660e6ffbee431070d5.tar.bz2 rneovim-66220d164a40791a5131d4660e6ffbee431070d5.zip |
revert: "feat(health): fold successful healthchecks #22866"
This reverts commit 4382d2ed564b80944345785d780cf1b19fb23ba8.
The story for this feature was left in an incomplete state. It was never
the intention to unilaterally fold all information, only the ones that
did not contain relevant information. This feature does more harm than
good in its incomplete state.
Diffstat (limited to 'runtime/lua/vim/health.lua')
-rw-r--r-- | runtime/lua/vim/health.lua | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/runtime/lua/vim/health.lua b/runtime/lua/vim/health.lua index 9e9c557ad3..18d20d4b40 100644 --- a/runtime/lua/vim/health.lua +++ b/runtime/lua/vim/health.lua @@ -2,42 +2,7 @@ local M = {} local s_output = {} ---@type string[] ---- Returns the fold text of the current healthcheck section -function M.foldtext() - local foldtext = vim.fn.foldtext() - - if vim.bo.filetype ~= 'checkhealth' then - return foldtext - end - - if vim.b.failedchecks == nil then - vim.b.failedchecks = vim.empty_dict() - end - - if vim.b.failedchecks[foldtext] == nil then - local warning = '- WARNING ' - local warninglen = string.len(warning) - local err = '- ERROR ' - local errlen = string.len(err) - local failedchecks = vim.b.failedchecks - failedchecks[foldtext] = false - - local foldcontent = vim.api.nvim_buf_get_lines(0, vim.v.foldstart - 1, vim.v.foldend, false) - for _, line in ipairs(foldcontent) do - if string.sub(line, 1, warninglen) == warning or string.sub(line, 1, errlen) == err then - failedchecks[foldtext] = true - break - end - end - - vim.b.failedchecks = failedchecks - end - - return vim.b.failedchecks[foldtext] and '+WE' .. foldtext:sub(4) or foldtext -end - ---- @param path string path to search for the healthcheck ---- @return string[] { name, func, type } representing a healthcheck +-- From a path return a list [{name}, {func}, {type}] representing a healthcheck local function filepath_to_healthcheck(path) path = vim.fs.normalize(path) local name --- @type string |