refactor(#1645): remove unused open_replacing_current_buffer (#2570)

This commit is contained in:
Alexander Courtis 2023-12-09 12:18:57 +11:00 committed by GitHub
parent 2fed5e1010
commit 27e66c2ea8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,30 +77,6 @@ function M.change_root(path, bufnr)
change_dir.fn(vim.fn.fnamemodify(path, ":p:h"))
end
---@param cwd string|nil
function M.open_replacing_current_buffer(cwd)
if view.is_visible() then
return
end
local buf = vim.api.nvim_get_current_buf()
local bufname = vim.api.nvim_buf_get_name(buf)
if bufname == "" or vim.loop.fs_stat(bufname) == nil then
return
end
if cwd == "" or cwd == nil then
cwd = vim.fn.fnamemodify(bufname, ":p:h")
end
if not core.get_explorer() or cwd ~= core.get_cwd() then
core.init(cwd)
end
view.open_in_win { hijack_current_buf = false, resize = false }
require("nvim-tree.renderer").draw()
require("nvim-tree.actions.finders.find-file").fn(bufname)
end
function M.tab_enter()
if view.is_visible { any_tabpage = true } then
local bufname = vim.api.nvim_buf_get_name(0)