diff --git a/lua/preview/compiler.lua b/lua/preview/compiler.lua index 36b5255..e19cbf0 100644 --- a/lua/preview/compiler.lua +++ b/lua/preview/compiler.lua @@ -91,17 +91,14 @@ function M.compile(bufnr, name, provider, ctx) table.concat(reload_cmd, ' ') ) - local obj - obj = vim.system( + local obj = vim.system( reload_cmd, { cwd = cwd, env = provider.env, }, vim.schedule_wrap(function(result) - if active[bufnr] and active[bufnr].obj == obj then - active[bufnr] = nil - end + active[bufnr] = nil if not vim.api.nvim_buf_is_valid(bufnr) then return end @@ -183,17 +180,14 @@ function M.compile(bufnr, name, provider, ctx) log.dbg('compiling buffer %d with provider "%s": %s', bufnr, name, table.concat(cmd, ' ')) - local obj - obj = vim.system( + local obj = vim.system( cmd, { cwd = cwd, env = provider.env, }, vim.schedule_wrap(function(result) - if active[bufnr] and active[bufnr].obj == obj then - active[bufnr] = nil - end + active[bufnr] = nil if not vim.api.nvim_buf_is_valid(bufnr) then return end