preview.nvim/lua/preview
Barrett Ruth 75b855438a
refactor: simplify command surface (#28)
* refactor: rename build to compile and watch to toggle in public API

Problem: the code used build/watch while the help file already
documented compile/toggle, creating a confusing mismatch.

Solution: rename M.build() to M.compile() and M.watch() to M.toggle()
in init.lua, update handler keys in commands.lua, and update the test
file to match.

* refactor(commands): make toggle the default subcommand

Problem: bare :Preview ran a one-shot compile, but users reaching for a
"preview" plugin expect it to start previewing (i.e. watch mode).

Solution: change the fallback subcommand from compile to toggle so
:Preview starts/stops auto-compile on save.

* refactor(commands): remove stop subcommand

Problem: :Preview stop had a subtle distinction from toggle-off (kill
process but keep autocmd) that nobody reaches for deliberately from
the command line.

Solution: remove stop from the command dispatch table. The Lua API
require('preview').stop() remains as a programmatic escape hatch.

* docs: update help file for new command surface and document reload

Problem: the help file listed compile as the default subcommand, still
included the stop subcommand, omitted the reload provider field, and
had a misleading claim about shipping with zero defaults.

Solution: make toggle the default in the commands section, remove stop
from subcommands, add reload to provider fields, fix the introduction
text, reorder API entries to match new primacy, and add an output path
override example addressing #26/#27.
2026-03-04 13:16:01 -05:00
..
commands.lua refactor: simplify command surface (#28) 2026-03-04 13:16:01 -05:00
compiler.lua fix(compiler): one-shot builds and :Preview open provider config (#25) 2026-03-04 02:18:28 -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 refactor: simplify command surface (#28) 2026-03-04 13:16:01 -05:00
log.lua feat: rename 2026-03-02 21:23:40 -05:00
presets.lua feat: unified reload field for live-preview (SSE + long-running watch) (#19) 2026-03-03 16:41:47 -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