feat(#1245): add next_diag_item and prev_diag_item actions
This commit is contained in:
@@ -84,20 +84,27 @@ function M.sibling(direction)
|
||||
end
|
||||
end
|
||||
|
||||
function M.find_git_item(where)
|
||||
function M.find_item(where, what)
|
||||
return function()
|
||||
local node_cur = lib.get_node_at_cursor()
|
||||
local nodes_by_line = utils.get_nodes_by_line(core.get_explorer().nodes, core.get_nodes_starting_line())
|
||||
|
||||
local cur, first, prev, nex = nil, nil, nil, nil
|
||||
for line, node in pairs(nodes_by_line) do
|
||||
if not first and node.git_status then
|
||||
local valid = false
|
||||
if what == "git" then
|
||||
valid = node.git_status ~= nil
|
||||
elseif what == "diag" then
|
||||
valid = node.diag_status ~= nil
|
||||
end
|
||||
|
||||
if not first and valid then
|
||||
first = line
|
||||
end
|
||||
|
||||
if node == node_cur then
|
||||
cur = line
|
||||
elseif node.git_status then
|
||||
elseif valid then
|
||||
if not cur then
|
||||
prev = line
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user