fix(compiler): skip reload command for one-shot builds
Problem: compile() unconditionally resolved the reload command, so
:Preview build on a provider with reload = function/table (e.g. typst)
would start a long-running process (typst watch) instead of a one-shot
compile (typst compile). Error diagnostics were also lost because
typst watch does not exit non-zero on input errors.
Solution: add an opts parameter to compile() with a oneshot flag.
M.build() passes { oneshot = true } so resolve_reload_cmd() is
skipped and the one-shot path is always taken. toggle() continues
to call compile() without the flag, preserving long-running behavior
for watch mode.
This commit is contained in:
parent
da3e3e4249
commit
c556ea9ea1
2 changed files with 8 additions and 3 deletions
|
|
@ -153,7 +153,7 @@ function M.build(bufnr)
|
|||
end
|
||||
local ctx = M.build_context(bufnr)
|
||||
local provider = config.providers[name]
|
||||
compiler.compile(bufnr, name, provider, ctx)
|
||||
compiler.compile(bufnr, name, provider, ctx, { oneshot = true })
|
||||
end
|
||||
|
||||
---@param bufnr? integer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue