aboutsummaryrefslogtreecommitdiff
path: root/lua/muwiki/health.lua
diff options
context:
space:
mode:
authormoxie <moxie@3kgcat.fi>2026-03-15 09:54:31 +0200
committermoxie <moxie@3kgcat.fi>2026-03-15 10:05:20 +0200
commitde2df63dcbe44f07dc994e29d7d400c49c811080 (patch)
tree10ae2c8eee90c661792e71aa5bd35cd26f5407d4 /lua/muwiki/health.lua
parent49c1e9d1fc3d6bf8748756a8543d8c1b7287940f (diff)
refactor: simplify codebase and fix FileType autocommands
Diffstat (limited to 'lua/muwiki/health.lua')
-rw-r--r--lua/muwiki/health.lua33
1 files changed, 2 insertions, 31 deletions
diff --git a/lua/muwiki/health.lua b/lua/muwiki/health.lua
index 22c9747..13c5523 100644
--- a/lua/muwiki/health.lua
+++ b/lua/muwiki/health.lua
@@ -1,15 +1,5 @@
-
-local utils = require('muwiki.utils')
-
local M = {}
-local function command_exists(cmd)
- if type(cmd) == 'function' then
- return true
- end
- return vim.fn.executable(cmd) == 1
-end
-
M.check = function()
vim.health.start('Wiki Setup')
@@ -26,7 +16,8 @@ M.check = function()
vim.health.info('Add to your config: dirs = {{name = "default", path = "~/wiki"}}')
else
for _, dir in ipairs(cfg.dirs) do
- if utils.dir_exists(dir.path) then
+ local stat = vim.uv.fs_stat(dir.path)
+ if stat and stat.type == 'directory' then
vim.health.ok(string.format("Wiki '%s': %s", dir.name, dir.path))
else
vim.health.warn(string.format("Wiki '%s': %s (not found)", dir.name, dir.path))
@@ -34,26 +25,6 @@ M.check = function()
end
end
- vim.health.start('External Handlers')
-
- if cfg.use_external_handlers then
- vim.health.ok('External handlers are enabled')
-
- for _, handler in ipairs(cfg.external_handlers) do
- if type(handler.cmd) == 'function' then
- vim.health.ok(string.format("Handler '%s': <Lua function>", handler.name))
- elseif command_exists(handler.cmd) then
- vim.health.ok(string.format("Handler '%s': %s", handler.name, handler.cmd))
- else
- vim.health.error(
- string.format("Handler '%s': command not found (%s)", handler.name, handler.cmd)
- )
- end
- end
- else
- vim.health.info('External handlers are disabled')
- end
-
vim.health.start('Treesitter (Required)')
local has_ts_parser = pcall(vim.treesitter.get_parser, 0, 'markdown')