fix: handle new tabs properly (#313)

This commit is contained in:
Kiyan
2021-04-18 11:11:56 +02:00
committed by GitHub
parent 79a8188ecf
commit 783870cda9
4 changed files with 24 additions and 24 deletions

View File

@@ -90,7 +90,7 @@ local function get_line_from_node(node, find_parent)
end
function M.get_node_at_cursor()
local cursor = api.nvim_win_get_cursor(view.View.winnr)
local cursor = api.nvim_win_get_cursor(view.get_winnr())
local line = cursor[1]
if line == 1 and M.Tree.cwd ~= "/" then
return { name = ".." }
@@ -353,7 +353,7 @@ function M.parent_node(node, should_close)
elseif should_close then
parent.open = false
end
api.nvim_win_set_cursor(view.View.winnr, {line, 0})
api.nvim_win_set_cursor(view.get_winnr(), {line, 0})
end
renderer.draw(M.Tree, true)
end