fix: error when opening nav view on file with no symbols (#256)

This commit is contained in:
Steven Arcangeli 2023-05-27 11:23:59 -07:00
parent 189bf4cce7
commit 30316db63d

View file

@ -335,7 +335,9 @@ M.open = function()
local bufdata = data.get(bufnr)
if bufdata then
local pos = window.get_symbol_position(bufdata, cursor[1], cursor[2], true)
_active_nav:focus_symbol(pos.closest_symbol)
if pos.closest_symbol then
_active_nav:focus_symbol(pos.closest_symbol)
end
end
end