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.
This commit is contained in:
Barrett Ruth 2026-03-04 13:10:52 -05:00
parent 7a7c407d97
commit 46cbf41612
Signed by: barrett
GPG key ID: A6C96C9349D2FC81

View file

@ -33,7 +33,7 @@ local handlers = {
---@param args string
local function dispatch(args)
local subcmd = args ~= '' and args or 'build'
local subcmd = args ~= '' and args or 'toggle'
local handler = handlers[subcmd]
if handler then
handler()
@ -58,7 +58,7 @@ function M.setup()
complete = function(lead)
return complete(lead)
end,
desc = 'Build, stop, clean, watch, open, or check status of document preview',
desc = 'Toggle, compile, clean, open, or check status of document preview',
})
end