nonicons.nvim/lua/nonicons/health.lua
Barrett Ruth 04791cd41a
feat: initial nonicons.nvim rewrite
Problem: the original ya2s/nvim-nonicons fork diverged enough that
maintaining it as a fork was pointless. The set_icon() approach broke
with modern nvim-web-devicons, and the extensions directory coupled
integrations that belong in user config.

Solution: from-scratch rewrite with function wrapping + table mutation
override engine, vim.g.nonicons config pattern, vendored mapping with
integer codepoints, health check, vimdoc with recipes, and no built-in
plugin integrations.
2026-02-17 19:34:13 -05:00

29 lines
749 B
Lua

local M = {}
function M.check()
vim.health.start('nonicons.nvim')
local ok, devicons = pcall(require, 'nvim-web-devicons')
if ok and devicons then
vim.health.ok('nvim-web-devicons available')
else
vim.health.error('nvim-web-devicons not found')
end
local result = vim.fn.system({ 'fc-list', ':family=nonicons' })
if result ~= '' then
vim.health.ok('nonicons font installed')
else
vim.health.warn('nonicons font not detected (fc-list :family=nonicons returned empty)')
end
local mapping = require('nonicons.mapping')
local count = vim.tbl_count(mapping)
if count > 0 then
vim.health.ok('mapping loaded (' .. count .. ' icons)')
else
vim.health.error('mapping table is empty')
end
end
return M