preview.nvim/lua/preview
Barrett Ruth e59b5eb241
refactor(compiler): replace 7 state tables with unified BufState
Problem: `compiler.lua` tracked per-buffer state across 7 separate
module-level tables, causing scattered cleanup, triplicated
error-handling blocks, accumulating `BufUnload` autocmds on every
compile, and a race condition where `active[bufnr]` (cleared
asynchronously on process exit) was used as the toggle on/off gate.

Solution: Consolidate all per-buffer state into a single `state` table
holding a `preview.BufState` record per buffer. Extract `handle_errors`
and `clear_errors` helpers. Move `BufUnload` lifecycle entirely into
`M.toggle` with `unload_autocmd` tracking to prevent accumulation.
Toggle now gates on `s.watching` (synchronous boolean) and reopens a
closed viewer when watching is active rather than stopping.
2026-03-05 23:54:07 -05:00
..
commands.lua fix: lifecycle cleanup and defensive runtime checks (#29) 2026-03-04 14:02:16 -05:00
compiler.lua refactor(compiler): replace 7 state tables with unified BufState 2026-03-05 23:54:07 -05:00
diagnostic.lua fix(presets): correct error parsers for real compiler output (#11) 2026-03-03 14:14:59 -05:00
health.lua feat: rename watch → toggle, auto-compile on start, built-in opener 2026-03-02 23:37:44 -05:00
init.lua feat: add extra_args provider field (#51) 2026-03-05 22:26:28 -05:00
log.lua feat: rename 2026-03-02 21:23:40 -05:00
presets.lua refactor(presets): simplify mermaid error parser (#49) 2026-03-05 12:05:34 -05:00
reload.lua fix(reload): bind SSE server to port 0 for OS-assigned port (#21) 2026-03-03 17:46:04 -05:00