Skip to content

Commit edf6ef5

Browse files
phanenalex-courtis
andauthored
Update lua/nvim-tree/actions/node/open-file.lua
Co-authored-by: Alexander Courtis <[email protected]>
1 parent e922baa commit edf6ef5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ local function open_file_in_tab(filename)
200200
end
201201
vim.cmd.tabnew()
202202
vim.bo.bufhidden = "wipe"
203-
-- HACK: prevent NvimTree to be alternate buffer
203+
-- 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.
204204
if utils.is_nvim_tree_buf(vim.fn.bufnr("#")) then
205205
local tmpbuf = vim.api.nvim_create_buf(false, true)
206206
vim.fn.setreg("#", tmpbuf)

0 commit comments

Comments
 (0)