diff --git a/lua/preview/compiler.lua b/lua/preview/compiler.lua index e19cbf0..9498d70 100644 --- a/lua/preview/compiler.lua +++ b/lua/preview/compiler.lua @@ -144,7 +144,7 @@ function M.compile(bufnr, name, provider, ctx) end) ) - if provider.open and not opened[bufnr] and 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