Compare commits
3 commits
a5ebccc292
...
c12891f7ea
| Author | SHA1 | Date | |
|---|---|---|---|
| c12891f7ea | |||
|
|
88dc47b643 | ||
|
|
54ef0c3c99 |
1 changed files with 16 additions and 5 deletions
|
|
@ -91,14 +91,17 @@ function M.compile(bufnr, name, provider, ctx)
|
|||
table.concat(reload_cmd, ' ')
|
||||
)
|
||||
|
||||
local obj = vim.system(
|
||||
local obj
|
||||
obj = vim.system(
|
||||
reload_cmd,
|
||||
{
|
||||
cwd = cwd,
|
||||
env = provider.env,
|
||||
},
|
||||
vim.schedule_wrap(function(result)
|
||||
active[bufnr] = nil
|
||||
if active[bufnr] and active[bufnr].obj == obj then
|
||||
active[bufnr] = nil
|
||||
end
|
||||
if not vim.api.nvim_buf_is_valid(bufnr) then
|
||||
return
|
||||
end
|
||||
|
|
@ -144,7 +147,12 @@ function M.compile(bufnr, name, provider, ctx)
|
|||
end)
|
||||
)
|
||||
|
||||
if provider.open and not opened[bufnr] and output_file ~= '' and vim.uv.fs_stat(output_file) then
|
||||
if
|
||||
provider.open
|
||||
and not opened[bufnr]
|
||||
and output_file ~= ''
|
||||
and vim.uv.fs_stat(output_file)
|
||||
then
|
||||
if provider.open == true then
|
||||
vim.ui.open(output_file)
|
||||
elseif type(provider.open) == 'table' then
|
||||
|
|
@ -180,14 +188,17 @@ function M.compile(bufnr, name, provider, ctx)
|
|||
|
||||
log.dbg('compiling buffer %d with provider "%s": %s', bufnr, name, table.concat(cmd, ' '))
|
||||
|
||||
local obj = vim.system(
|
||||
local obj
|
||||
obj = vim.system(
|
||||
cmd,
|
||||
{
|
||||
cwd = cwd,
|
||||
env = provider.env,
|
||||
},
|
||||
vim.schedule_wrap(function(result)
|
||||
active[bufnr] = nil
|
||||
if active[bufnr] and active[bufnr].obj == obj then
|
||||
active[bufnr] = nil
|
||||
end
|
||||
if not vim.api.nvim_buf_is_valid(bufnr) then
|
||||
return
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue