refacto: abstract TreeExplorer in core.lua
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user