From 3445d3fefa57ff10562acd37e097745f80b38ad9 Mon Sep 17 00:00:00 2001 From: kiyan Date: Sat, 28 Aug 2021 13:59:05 +0200 Subject: [PATCH] fix: only hijack current window if tree should open at start --- lua/nvim-tree.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/nvim-tree.lua b/lua/nvim-tree.lua index 2142f840..5e36cd89 100644 --- a/lua/nvim-tree.lua +++ b/lua/nvim-tree.lua @@ -210,7 +210,7 @@ function M.on_enter() local should_open = vim.g.nvim_tree_auto_open == 1 and ((is_dir and netrw_disabled) or (bufname == "" and not buf_has_content)) and not vim.tbl_contains(ft_ignore, buftype) - if bufname == '' or is_dir then + if should_open then M.hijack_current_window() end lib.init(should_open, should_open)