move lib.get_node_at_cursor to Explorer

This commit is contained in:
Alexander Courtis
2024-10-21 11:34:10 +11:00
parent 0992969dc5
commit 7324fb1bf0
11 changed files with 88 additions and 87 deletions

View File

@@ -1,6 +1,5 @@
local utils = require("nvim-tree.utils")
local core = require("nvim-tree.core")
local lib = require("nvim-tree.lib")
local Iterator = require("nvim-tree.iterators.node-iterator")
local DirectoryNode = require("nvim-tree.node.directory")
@@ -26,10 +25,13 @@ end
---@param keep_buffers boolean
function M.fn(keep_buffers)
local node = lib.get_node_at_cursor()
local explorer = core.get_explorer()
if not explorer then
return
end
if explorer == nil then
local node = explorer:get_node_at_cursor()
if not node then
return
end