hedyhli / outline.nvim

Code outline sidebar powered by LSP. Significantly enhanced & refactored fork of symbols-outline.nvim.
https://sr.ht/~hedy/outline.nvim
MIT License
543 stars 15 forks source link

Error invoking outline if no lsp is attached to buffer #39

Closed gennaro-tedesco closed 8 months ago

gennaro-tedesco commented 8 months ago

I am running neovim nightly with

NVIM v0.10.0-dev-1496+g4c8fdc018-Homebrew
Build type: Release
LuaJIT 2.1.1700008891

and I am on commit 2dd9ea2f57fb1d1426d4737418322dae48a59154 (the latest, as I can see). Whenever I invoke Outline on a buffer that has no lsp attached I see the following exception being raised:

Error detected while processing CursorMoved Autocommands for "<buffer=2>":
Error executing lua callback: ...cal/share/nvim/lazy/outline.nvim/lua/outline/sidebar.lua:375: attempt to index local 'node' (a nil value)
stack traceback:
    ...cal/share/nvim/lazy/outline.nvim/lua/outline/sidebar.lua:375: in function '__goto_location'
    ...cal/share/nvim/lazy/outline.nvim/lua/outline/sidebar.lua:198: in function <...cal/share/nvim/lazy/outline.nvim/lua/outline/sidebar.lua:196>

I am not sure whether this has been introduced of late, I do not remember seeing such exception before?

hedyhli commented 8 months ago

I wasn't able to reproduce this issue. However, I recently pushed a fix to a similar issue which might fix this one.

If you're still encountering this issue after the latest commit, please send your outline.nvim config and I will test with neovim nightly. Thanks.

gennaro-tedesco commented 8 months ago

After the latest commit I no longer see the exception, thank you for looking into it!