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

@@ -3,6 +3,7 @@ local uv = vim.loop
local lib = require "nvim-tree.lib"
local utils = require "nvim-tree.utils"
local core = require "nvim-tree.core"
local M = {}
@@ -168,7 +169,7 @@ end
function M.copy_path(node)
local absolute_path = node.absolute_path
local relative_path = utils.path_relative(absolute_path, TreeExplorer.cwd)
local relative_path = utils.path_relative(absolute_path, core.get_cwd())
local content = node.nodes ~= nil and utils.path_add_trailing(relative_path) or relative_path
return copy_to_clipboard(content)
end