Commit graph

7 commits

Author SHA1 Message Date
6f445c30d6
fix: duplicate table index 2026-02-23 17:27:13 -05:00
b6d8733c3e
ci: format 2026-02-23 17:26:04 -05:00
6a8668fab5
fix(ci): luacats support 2026-02-23 17:25:57 -05:00
747e7b6222
fix: make fname resolution more robust; 2026-02-23 17:19:30 -05:00
Barrett Ruth
d07145eeae
feat: add public file-icon API (#10)
* refactor: extract resolution tables into resolve module

Problem: ext_map, filename_map, and resolve() are locked inside
override.lua as locals, making them inaccessible to any code path
that doesn't go through the devicons monkey-patch.

Solution: extract all resolution tables and logic into a new
nonicons.resolve module. Fix Gemfile/Jenkinsfile case bug (keys
were uppercase but resolve() lowercases input before lookup). Add
ft_map for vim filetypes that don't match extension or mapping keys.

* refactor: wire override.lua to resolve module

Problem: override.lua still has its own copies of ext_map,
filename_map, and resolve(), duplicating the newly extracted
resolve module.

Solution: replace local tables and resolve() with imports from
nonicons.resolve. Update all *_by_filetype overrides to use
resolve_filetype() instead of raw ext_map[ft], gaining ft_map
fallback and direct mapping key lookup.

* feat: add get_icon and get_icon_by_filetype API

Problem: plugins that don't use devicons have no way to get nonicons
glyphs for files. The only integration path is the devicons
monkey-patch via apply().

Solution: add get_icon(name, ext) and get_icon_by_filetype(ft) to
the public API in init.lua. Both use lazy require of the resolve
module and return nil on miss so callers decide fallback. Document
both functions in vimdoc and update the oil.nvim recipe.
2026-02-22 21:35:45 -05:00
Barrett Ruth
17aa14259a
feat: add mapping sync check and improve vimdoc (#6)
Some checks are pending
luarocks / quality (push) Waiting to run
luarocks / publish (push) Blocked by required conditions
* feat(doc): fix phrasing

* ci: add upstream mapping sync check to quality workflow

Problem: mapping.lua can silently fall behind the ya2s/nonicons font
repo with no indication that new icons are available.

Solution: add a mapping-sync job that fetches nonicon.json from
upstream, generates the expected mapping.lua, and fails the check
if they differ.

* fix: sort alphabetically

* fix(ci): dont respect alphabetical order in font checker
2026-02-17 21:07:32 -05:00
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