From 62e3ca3e2bbcabedc024fb223d6e5fcfabad467e Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Mon, 10 Oct 2022 15:34:36 +0100 Subject: [PATCH] feat(man): add health check Fixes #20432 (cherry picked from commit 4ccc57fd7a1445770a6cd7c85aa76a3a8928295b) --- runtime/lua/man/health.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 runtime/lua/man/health.lua diff --git a/runtime/lua/man/health.lua b/runtime/lua/man/health.lua new file mode 100644 index 0000000000..11d7148216 --- /dev/null +++ b/runtime/lua/man/health.lua @@ -0,0 +1,20 @@ +local M = {} + +local report_ok = vim.fn['health#report_ok'] +local report_error = vim.fn['health#report_error'] + +local function check_runtime_file(name) + local path = vim.env.VIMRUNTIME .. '/' .. name + if vim.loop.fs_stat(path) then + report_error(string.format('%s detected. Please delete %s', name, path)) + else + report_ok(string.format('%s not in $VIMRUNTIME', name)) + end +end + +function M.check() + check_runtime_file('plugin/man.vim') + check_runtime_file('autoload/man.vim') +end + +return M