mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
fix(terminal): check win valid before creating a new terminal (#1927)
## Description Checking the win vaild also before creating a new terminal ## Related Issue(s) - Fixes #1926 --------- Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
This commit is contained in:
parent
8abbb9e6e0
commit
ba7bbcd0df
1 changed files with 1 additions and 1 deletions
|
|
@ -701,7 +701,7 @@ function M:open_win()
|
|||
elseif position == "current" then
|
||||
self.win = vim.api.nvim_get_current_win()
|
||||
else
|
||||
local parent = self.opts.win or 0
|
||||
local parent = self.opts.win and vim.api.nvim_win_is_valid(self.opts.win) and self.opts.win or 0
|
||||
local vertical = position == "left" or position == "right"
|
||||
if parent == 0 then
|
||||
for _, win in ipairs(vim.api.nvim_tabpage_list_wins(0)) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue