Closed
Description
Description
(First, great work on this plugin, I really like it and use everyday).
I tried to improve my nvim-tree
config replacing some nvim-tree.lib
with the relatives from the new Api
module.
But on trying I’m always getting an error in import that module, specifically this field copy in api!
The error is : attempt to index field copy (a function value)
Neovim version
NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@Monterey
Operating system and version
macOS 12.0.1
nvim-tree version
Minimal config
local ok, nvim_tree = pcall(require, "nvim-tree")
if not ok then return end
local api = require "nvim-tree.api"
local function trash_file()
local node = api.get_node_under_cursor()
-- code
api.tree.reload()
end
local function vsplit_preview()
local node = api.get_node_under_cursor()
if node.link_to and not node.nodes then
api.tree.open(node.link_to)
else
api.tree.open(node.absolute_path)
end
api.tree.focus()
end
Steps to reproduce
nvim
Expected behavior
No response
Actual behavior
No response