Skip to content

Commit

Permalink
fix(Runner): warning on terminal window close
Browse files Browse the repository at this point in the history
  • Loading branch information
Dax89 committed Apr 20, 2023
1 parent 3bd4341 commit 30d1d85
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/automaton/runner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ end

function Runner.close_terminal()
if Runner.termbufid ~= nil then
vim.api.nvim_win_close(Runner.termwinid, true)
if vim.fn.winbufnr(Runner.termbufid) ~= -1 then
vim.api.nvim_win_close(Runner.termwinid, true)
end

vim.api.nvim_command("silent! :bd! " .. tostring(Runner.termbufid))

Runner.termbufid = nil
Runner.termwinid = nil
end
Expand Down

0 comments on commit 30d1d85

Please sign in to comment.