preview.nvim/spec
Barrett Ruth f185ae78f7
fix: fall back to /tmp for buffers without a backing file (#60)
* fix: fall back to /tmp for buffers without a backing file

Problem: markdown and gfm presets fail when the buffer has no file on
disk (e.g. unnamed buffer with `ft=markdown`, or a named buffer whose
path doesn't exist yet) because `build_context` passes a nonexistent
path to pandoc and `compile` guards reject empty buffer names.

Solution: `build_context` now detects missing files and redirects
`ctx.file` to `/tmp/{bufnr}-{name}`. `compile` writes buffer contents
to that temp path via `vim.fn.writefile` instead of `:silent! update`.

* test: update unnamed buffer tests for tmpfile fallback

Problem: the unnamed buffer guard tests expected a "no file name"
warning that no longer exists after the tmpfile fallback change.

Solution: update assertions to expect the downstream messages that
unnamed buffers now reach ("no provider configured", "no output file").
2026-03-13 08:22:45 -04:00
..
commands_spec.lua fix: lifecycle cleanup and defensive runtime checks (#29) 2026-03-04 14:02:16 -05:00
compiler_spec.lua feat: compile notifications and long-running provider feedback (#55) 2026-03-06 14:58:10 -05:00
diagnostic_spec.lua feat: compile notifications and long-running provider feedback (#55) 2026-03-06 14:58:10 -05:00
helpers.lua feat: rename watch → toggle, auto-compile on start, built-in opener 2026-03-02 23:37:44 -05:00
init_spec.lua fix: fall back to /tmp for buffers without a backing file (#60) 2026-03-13 08:22:45 -04:00
minimal_init.lua ci: format 2026-03-01 17:22:59 -05:00
presets_spec.lua feat: compile notifications and long-running provider feedback (#55) 2026-03-06 14:58:10 -05:00
reload_spec.lua fix(ci): resolve lua-language-server warnings (#32) 2026-03-04 14:28:52 -05:00