refactor(#2826): View is an Explorer member
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
local utils = require("nvim-tree.utils")
|
||||
local view = require("nvim-tree.view")
|
||||
local core = require("nvim-tree.core")
|
||||
local diagnostics = require("nvim-tree.diagnostics")
|
||||
|
||||
@@ -67,9 +66,9 @@ local function move(explorer, where, what, skip_gitignored)
|
||||
end
|
||||
|
||||
if nex then
|
||||
view.View:set_cursor({ nex, 0 })
|
||||
explorer.view:set_cursor({ nex, 0 })
|
||||
elseif vim.o.wrapscan and first then
|
||||
view.View:set_cursor({ first, 0 })
|
||||
explorer.view:set_cursor({ first, 0 })
|
||||
end
|
||||
end
|
||||
|
||||
@@ -189,13 +188,13 @@ local function move_prev_recursive(explorer, what, skip_gitignored)
|
||||
|
||||
-- 4.3)
|
||||
if node_init.name == ".." then -- root node
|
||||
view.View:set_cursor({ 1, 0 }) -- move to root node (position 1)
|
||||
explorer.view:set_cursor({ 1, 0 }) -- move to root node (position 1)
|
||||
else
|
||||
local node_init_line = utils.find_node_line(node_init)
|
||||
if node_init_line < 0 then
|
||||
return
|
||||
end
|
||||
view.View:set_cursor({ node_init_line, 0 })
|
||||
explorer.view:set_cursor({ node_init_line, 0 })
|
||||
end
|
||||
|
||||
-- 4.4)
|
||||
|
||||
Reference in New Issue
Block a user