Commit graph

19 commits

Author SHA1 Message Date
7d35b23ba0
fix: resolve luacats return-type-mismatch and cast-local-type warnings
Problem: lua-language-server reports two diagnostics in override.lua:
char() returns string? but resolve() annotates its return as string,
and fallback_icon is typed as string but assigned a string? value.

Solution: add fallback values so both assignments satisfy the string
type — resolve() falls back to fallback_icon, and fallback_icon falls
back to an empty string.
2026-02-23 17:31:45 -05:00
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
5426ec037f
doc: improve q&a format 2026-02-21 23:02:31 -05:00
Barrett Ruth
62549ecb99
feat(ci): add scheduled upstream mapping sync workflow (#9)
Problem: mapping.lua can silently drift from the ya2s/nonicons upstream
font. The existing CI check only runs on PRs/pushes and just fails
without any actionable follow-up.

Solution: add a daily scheduled workflow that generates mapping.lua from
upstream nonicon.json and opens (or updates) a PR via
peter-evans/create-pull-request. Reuses the same branch to avoid spam.

Closes #7
2026-02-18 13:25:39 -05:00
Barrett Ruth
e6d3a78eb3
fix: ghostty install instructions (#8)
* fix: ghostty install isntructions

* fix(docs): lazy = false
2026-02-18 12:51:22 -05:00
Barrett Ruth
6f7670d1a7
Update README.md 2026-02-17 21:18:36 -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
Barrett Ruth
6b4f5cf150
feat(doc): fix phrasing (#5) 2026-02-17 20:46:28 -05:00
Barrett Ruth
a31bc21def
docs(readme): replace lazy.nvim FAQ with recipes reference (#4)
* docs(readme): replace lazy.nvim FAQ with recipes reference

Problem: the FAQ inlined a lazy.nvim snippet that duplicates vimdoc
content and doesn't cover other plugin integrations.

Solution: replace with a generic "How do I integrate with plugin <X>?"
entry pointing to :help nonicons-recipes. Also track flake.lock.

* fix(ci): format
2026-02-17 20:35:20 -05:00
Barrett Ruth
7ba8508995
Enhance README feature description with link
Updated feature description to include link to nvim-web-devicons.
2026-02-17 20:30:17 -05:00
Barrett Ruth
59bc39b4c9
Update README with image for nonicons.nvim 2026-02-17 20:29:47 -05:00
Barrett Ruth
a6d82b16fb
Merge pull request #3 from barrettruth/feat/init
feat: add project infrastructure and rewrite README
2026-02-17 20:21:16 -05:00
8f3459132d
fix: remove tracked .envrc
Problem: .envrc is a local developer preference file that should not be
tracked in the repository.

Solution: remove .envrc from version control.
2026-02-17 20:07:40 -05:00
731cb89059
feat: add project infrastructure and rewrite README
Problem: nonicons.nvim lacks CI, pre-commit hooks, nix dev shell, issue
templates, and the README contains content that duplicates the vimdoc.

Solution: add quality/luarocks CI workflows, pre-commit config, nix
flake, prettier config, GitHub issue/discussion templates, and rewrite
the README to minimal style with all detailed content in vimdoc. Update
yamatsum/nonicons references to ya2s/nonicons.
2026-02-17 20:07:16 -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