Skip to content

Commit 89816ac

Browse files
authored
fix(#2191): edit: disregard floating windows (#2209)
1 parent 498e879 commit 89816ac

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lua/nvim-tree/actions/node/open-file.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,12 @@ local function open_in_new_window(filename, mode)
237237
return
238238
end
239239

240-
local win_ids = vim.api.nvim_list_wins()
240+
-- non-floating windows
241+
local win_ids = vim.tbl_filter(function(id)
242+
local config = vim.api.nvim_win_get_config(id)
243+
return config and config.relative == ""
244+
end, vim.api.nvim_list_wins())
245+
241246
local create_new_window = #win_ids == 1 -- This implies that the nvim-tree window is the only one
242247
local new_window_side = (view.View.side == "right") and "aboveleft" or "belowright"
243248

0 commit comments

Comments
 (0)