mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
fix(terminal): check win valid before creating new terminal
This commit is contained in:
parent
bc0630e43b
commit
8ca577b4b5
1 changed files with 1 additions and 1 deletions
|
@ -173,7 +173,7 @@ function M.get(cmd, opts)
|
|||
opts = opts or {}
|
||||
local id = vim.inspect({ cmd = cmd, cwd = opts.cwd, env = opts.env, count = vim.v.count1 })
|
||||
local created = false
|
||||
if not (terminals[id] and terminals[id]:buf_valid()) and (opts.create ~= false) then
|
||||
if not (terminals[id] and terminals[id]:win_valid() and terminals[id]:buf_valid()) and (opts.create ~= false) then
|
||||
local ret = M.open(cmd, opts)
|
||||
ret:on("BufWipeout", function()
|
||||
terminals[id] = nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue