* Revert "fix(#3172): live filter exception (#3173)" This reverts commit0a7fcdf3f8. * Revert "refactor(#2826): move view to instanced window class (#3153)" This reverts commit0a06f65bf0. * feat(#3157): add view.cursorlineopt
This commit is contained in:
committed by
GitHub
parent
9b289abd69
commit
a4699c0904
@@ -1,4 +1,5 @@
|
||||
local utils = require("nvim-tree.utils")
|
||||
local view = require("nvim-tree.view")
|
||||
local core = require("nvim-tree.core")
|
||||
local diagnostics = require("nvim-tree.diagnostics")
|
||||
|
||||
@@ -66,9 +67,9 @@ local function move(explorer, where, what, skip_gitignored)
|
||||
end
|
||||
|
||||
if nex then
|
||||
explorer.view:set_cursor({ nex, 0 })
|
||||
view.set_cursor({ nex, 0 })
|
||||
elseif vim.o.wrapscan and first then
|
||||
explorer.view:set_cursor({ first, 0 })
|
||||
view.set_cursor({ first, 0 })
|
||||
end
|
||||
end
|
||||
|
||||
@@ -188,13 +189,13 @@ local function move_prev_recursive(explorer, what, skip_gitignored)
|
||||
|
||||
-- 4.3)
|
||||
if node_init.name == ".." then -- root node
|
||||
explorer.view:set_cursor({ 1, 0 }) -- move to root node (position 1)
|
||||
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
|
||||
explorer.view:set_cursor({ node_init_line, 0 })
|
||||
view.set_cursor({ node_init_line, 0 })
|
||||
end
|
||||
|
||||
-- 4.4)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
local view = require("nvim-tree.view")
|
||||
local utils = require("nvim-tree.utils")
|
||||
|
||||
local DirectoryNode = require("nvim-tree.node.directory")
|
||||
@@ -24,7 +25,7 @@ function M.fn(should_close)
|
||||
local parent = (node:get_parent_of_group() or node).parent
|
||||
|
||||
if not parent or not parent.parent then
|
||||
node.explorer.view:set_cursor({ 1, 0 })
|
||||
view.set_cursor({ 1, 0 })
|
||||
return
|
||||
end
|
||||
|
||||
@@ -32,7 +33,7 @@ function M.fn(should_close)
|
||||
return n.absolute_path == parent.absolute_path
|
||||
end)
|
||||
|
||||
node.explorer.view:set_cursor({ line + 1, 0 })
|
||||
view.set_cursor({ line + 1, 0 })
|
||||
if should_close then
|
||||
parent.open = false
|
||||
parent.explorer.renderer:draw()
|
||||
|
||||
Reference in New Issue
Block a user