fix: wait for win opening before running place_cursor_on_node

This commit is contained in:
kiyan
2021-06-04 08:15:45 +02:00
parent 6dca42d09d
commit 747bce0c66

View File

@@ -195,6 +195,9 @@ function M.reset_highlight()
end end
function M.place_cursor_on_node() function M.place_cursor_on_node()
-- to avoid crashing on startup
if not view.win_open() then return end
local node = lib.get_node_at_cursor() local node = lib.get_node_at_cursor()
if not node then return end if not node then return end
local line = api.nvim_get_current_line() local line = api.nvim_get_current_line()