move lib.get_cursor_position to Explorer

This commit is contained in:
Alexander Courtis
2024-10-21 10:56:45 +11:00
parent 8331a24c77
commit 0992969dc5
3 changed files with 21 additions and 19 deletions

View File

@@ -34,11 +34,16 @@ end
---@param what string type of status
---@param skip_gitignored boolean default false
local function move(where, what, skip_gitignored)
local explorer = core.get_explorer()
if not explorer then
return
end
local first_node_line = core.get_nodes_starting_line()
local nodes_by_line = utils.get_nodes_by_line(core.get_explorer().nodes, first_node_line)
local nodes_by_line = utils.get_nodes_by_line(explorer.nodes, first_node_line)
local iter_start, iter_end, iter_step, cur, first, nex
local cursor = lib.get_cursor_position()
local cursor = explorer:get_cursor_position()
if cursor and cursor[1] < first_node_line then
cur = cursor[1]
end