Skip to content

Commit 8238865

Browse files
authored
fix: do not open files in floating windows, fixes #692 (#694)
1 parent 8af176e commit 8238865

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lua/neo-tree/utils.lua

+7-3
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,13 @@ M.get_appropriate_window = function(state)
441441
end
442442
end
443443
local attempts = 0
444-
while attempts < 5 and vim.bo.filetype == "neo-tree" do
445-
attempts = attempts + 1
446-
vim.cmd("wincmd w")
444+
while attempts < 5 and not suitable_window_found do
445+
if vim.bo.filetype == "neo-tree" or M.is_floating() then
446+
attempts = attempts + 1
447+
vim.cmd("wincmd w")
448+
else
449+
suitable_window_found = true
450+
end
447451
end
448452

449453
local winid = vim.api.nvim_get_current_win()

0 commit comments

Comments
 (0)