Update lua/nvim-tree/actions/node/open-file.lua
Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
parent
e922baab5e
commit
edf6ef5e86
@ -200,7 +200,7 @@ local function open_file_in_tab(filename)
|
|||||||
end
|
end
|
||||||
vim.cmd.tabnew()
|
vim.cmd.tabnew()
|
||||||
vim.bo.bufhidden = "wipe"
|
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
|
if utils.is_nvim_tree_buf(vim.fn.bufnr("#")) then
|
||||||
local tmpbuf = vim.api.nvim_create_buf(false, true)
|
local tmpbuf = vim.api.nvim_create_buf(false, true)
|
||||||
vim.fn.setreg("#", tmpbuf)
|
vim.fn.setreg("#", tmpbuf)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user