fix: prevent NvimTree to be alternate buffer when tab open
This commit is contained in:
parent
87d096a39c
commit
26dd7dbf3e
@ -198,7 +198,14 @@ local function open_file_in_tab(filename)
|
|||||||
if M.relative_path then
|
if M.relative_path then
|
||||||
filename = utils.path_relative(filename, vim.fn.getcwd())
|
filename = utils.path_relative(filename, vim.fn.getcwd())
|
||||||
end
|
end
|
||||||
vim.cmd("tabe " .. vim.fn.fnameescape(filename))
|
vim.cmd.tabnew()
|
||||||
|
-- HACK: prevent NvimTree to be alternate buffer
|
||||||
|
if utils.is_nvim_tree_buf(vim.fn.bufnr("#")) then
|
||||||
|
local tmpbuf = vim.api.nvim_create_buf(false, true)
|
||||||
|
vim.fn.setreg("#", tmpbuf)
|
||||||
|
vim.api.nvim_buf_delete(tmpbuf, { force = true })
|
||||||
|
end
|
||||||
|
vim.cmd.edit(vim.fn.fnameescape(filename))
|
||||||
end
|
end
|
||||||
|
|
||||||
local function drop(filename)
|
local function drop(filename)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user