refacto: abstract TreeExplorer in core.lua

This commit is contained in:
kiyan
2022-03-09 22:01:54 +01:00
parent d2b12d6055
commit 471afc13fe
17 changed files with 94 additions and 65 deletions

View File

@@ -1,4 +1,5 @@
local utils = require "nvim-tree.utils"
local core = require "nvim-tree.core"
local M = {}
@@ -7,7 +8,7 @@ local M = {}
---(the topmost node in the nvim-tree window)
local function get_node_path(node)
if node.name == ".." then
return utils.path_remove_trailing(TreeExplorer.cwd)
return utils.path_remove_trailing(core.get_cwd())
else
return node.absolute_path
end