Skip to content

Commit b657405

Browse files
authored
fix(#2191): edit: disregard floating windows (#2212)
1 parent 89816ac commit b657405

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,11 @@ local function open_in_new_window(filename, mode)
237237
return
238238
end
239239

240-
-- non-floating windows
240+
-- non-floating, non-nvim-tree windows
241241
local win_ids = vim.tbl_filter(function(id)
242242
local config = vim.api.nvim_win_get_config(id)
243-
return config and config.relative == ""
243+
local bufnr = vim.api.nvim_win_get_buf(id)
244+
return config and config.relative == "" or utils.is_nvim_tree_buf(bufnr)
244245
end, vim.api.nvim_list_wins())
245246

246247
local create_new_window = #win_ids == 1 -- This implies that the nvim-tree window is the only one

0 commit comments

Comments
 (0)