fix(compiler): respect provider open config in M.open()
Problem: :Preview open always called vim.ui.open regardless of the
provider's open field. Providers configured with a custom opener
(e.g. open = { 'sioyek', '--new-instance' }) were ignored, so the
first build opened with sioyek but :Preview open fell back to the
system default.
Solution: init.lua resolves the provider's open config and passes it
to compiler.open(). If open_config is a table, the custom command is
spawned with the output path appended. Otherwise vim.ui.open is used
as before.
This commit is contained in:
parent
c556ea9ea1
commit
f87f478612
2 changed files with 11 additions and 3 deletions
|
|
@ -190,7 +190,9 @@ end
|
|||
---@param bufnr? integer
|
||||
function M.open(bufnr)
|
||||
bufnr = bufnr or vim.api.nvim_get_current_buf()
|
||||
if not compiler.open(bufnr) then
|
||||
local name = M.resolve_provider(bufnr)
|
||||
local open_config = name and config.providers[name] and config.providers[name].open
|
||||
if not compiler.open(bufnr, open_config) then
|
||||
vim.notify('[preview.nvim] no output file available for this buffer', vim.log.levels.WARN)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue