From edf6ef5e861b9d8ddc1fc751dfa3db190d6523bc Mon Sep 17 00:00:00 2001 From: phanium <91544758+phanen@users.noreply.github.com> Date: Tue, 7 Oct 2025 09:40:08 +0800 Subject: [PATCH] Update lua/nvim-tree/actions/node/open-file.lua Co-authored-by: Alexander Courtis --- lua/nvim-tree/actions/node/open-file.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/nvim-tree/actions/node/open-file.lua b/lua/nvim-tree/actions/node/open-file.lua index a17aa25a..600f8656 100644 --- a/lua/nvim-tree/actions/node/open-file.lua +++ b/lua/nvim-tree/actions/node/open-file.lua @@ -200,7 +200,7 @@ local function open_file_in_tab(filename) end vim.cmd.tabnew() vim.bo.bufhidden = "wipe" - -- HACK: prevent NvimTree to be alternate buffer + -- Following vim.fn.tabnew the # buffer may be set to the tree buffer. There is no way to clear the # buffer via vim.fn.setreg as it requires a valid buffer. Clear # by setting it to a new temporary scratch buffer. if utils.is_nvim_tree_buf(vim.fn.bufnr("#")) then local tmpbuf = vim.api.nvim_create_buf(false, true) vim.fn.setreg("#", tmpbuf)