fix: address R1 (image.nvim backend) + C4 (cat-gate consistency)

Tackles the two outstanding items from the post-fix consistency
pass on top of `df2f776`.

* R1 -- plugin/27_image.lua: removed the explicit `backend = "auto"`
  line. image.nvim's setup() does not accept "auto" / "none" as
  literal values; the practical default is to leave `backend` unset,
  letting image.nvim auto-detect the right graphics protocol
  (kitty / wezterm / iterm / sixel) at runtime and falling back to
  no rendering on unsupported terminals. Inline comment explains the
  omission so a future reader doesn't "fix" it back.

* C4 -- modules/module/specs/plugins.nix:
  - Removed `nvim-dap`, `nvim-dap-ui`, `nvim-dap-virtual-text`,
    and `image-nvim` from `config.specs.utils-lazy`. They are R- and
    Markdown-specific, not general utility plugins, so they should
    not depend on `utils=true`.
  - Added a new `config.specs.r-lazy` spec carrying those same four
    plugins, gated by `cats.r`. Users with `r=true` and `utils=false`
    now get a working R debugger (via vscDebugger) and in-buffer
    image rendering for plots.
  - Added `image-nvim` to the existing `config.specs.markdown-lazy`
    so users with `markdown=true` and no other cats still see inline
    plots in Quarto / Markdown documents. nixCats dedups packages
    by pname, so `image-nvim` appears once on the runtime path even
    when both `r` and `markdown` are on.

These two changes close the real correctness bugs surfaced by the
consistency review: `plugin/26_dap.lua` and `plugin/27_image.lua`'s
cat-gated `Config.add(...)` calls previously depended on
`utils=true` resolving the four packages, leaving `r=true` (or
`markdown=true`) only users without DAP / image-nvim even though the
Lua gate let the setup function proceed.

Files: 2 modified. Local verification (`nix flake check --no-build`)
still required before merging PR #12.
This commit is contained in:
Daniel 2026-07-26 06:47:58 +00:00
commit 3f2ab6ef96
2 changed files with 17 additions and 3 deletions

View file

@ -70,6 +70,7 @@ in {
lazy = true; lazy = true;
data = [ data = [
config.nvim-lib.neovimPlugins.cmp-pandoc-references config.nvim-lib.neovimPlugins.cmp-pandoc-references
pkgs.vimPlugins.image-nvim
]; ];
}; };
@ -184,11 +185,20 @@ in {
colorful-menu-nvim colorful-menu-nvim
conform-nvim conform-nvim
copilot-lua copilot-lua
nvim-lint
vim-slime
];
};
-- Lazy-loaded plugins needed when the `r` cat is on. Kept separate from
-- `utils-lazy` so users with `r=true` and `utils=false` still get the
-- R debugger (via vscDebugger) and in-buffer image rendering for plots.
config.specs.r-lazy = lib.mkIf (config.cats.r or false) {
lazy = true;
data = with pkgs.vimPlugins; [
nvim-dap nvim-dap
nvim-dap-ui nvim-dap-ui
nvim-dap-virtual-text nvim-dap-virtual-text
nvim-lint
vim-slime
image-nvim image-nvim
]; ];
}; };

View file

@ -24,7 +24,11 @@ later(function()
end end
image.setup({ image.setup({
backend = "auto", -- Backend is intentionally NOT set so image.nvim auto-detects the
-- graphics protocol (kitty / wezterm / iterm / sixel) at runtime and
-- falls back to no rendering on unsupported terminals. The literal
-- strings "auto" / "none" are not accepted by image.nvim.setup(), so
-- setting either would silently disable rendering everywhere.
integrations = { integrations = {
markdown = { markdown = {
enabled = true, enabled = true,