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:
parent
7a7c407d97
commit
46cbf41612
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue