preview.nvim/lua
Barrett Ruth c1734eec8f
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`.
2026-03-13 08:19:57 -04:00
..
preview fix: fall back to /tmp for buffers without a backing file 2026-03-13 08:19:57 -04:00