Skip to content

Commit 27e66c2

Browse files
authored
refactor(#1645): remove unused open_replacing_current_buffer (#2570)
1 parent 2fed5e1 commit 27e66c2

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

lua/nvim-tree.lua

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -77,30 +77,6 @@ function M.change_root(path, bufnr)
7777
change_dir.fn(vim.fn.fnamemodify(path, ":p:h"))
7878
end
7979

80-
---@param cwd string|nil
81-
function M.open_replacing_current_buffer(cwd)
82-
if view.is_visible() then
83-
return
84-
end
85-
86-
local buf = vim.api.nvim_get_current_buf()
87-
local bufname = vim.api.nvim_buf_get_name(buf)
88-
if bufname == "" or vim.loop.fs_stat(bufname) == nil then
89-
return
90-
end
91-
92-
if cwd == "" or cwd == nil then
93-
cwd = vim.fn.fnamemodify(bufname, ":p:h")
94-
end
95-
96-
if not core.get_explorer() or cwd ~= core.get_cwd() then
97-
core.init(cwd)
98-
end
99-
view.open_in_win { hijack_current_buf = false, resize = false }
100-
require("nvim-tree.renderer").draw()
101-
require("nvim-tree.actions.finders.find-file").fn(bufname)
102-
end
103-
10480
function M.tab_enter()
10581
if view.is_visible { any_tabpage = true } then
10682
local bufname = vim.api.nvim_buf_get_name(0)

0 commit comments

Comments
 (0)