Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor position outside buffer #11

Open
Chakotay opened this issue Jan 13, 2025 · 4 comments
Open

Cursor position outside buffer #11

Chakotay opened this issue Jan 13, 2025 · 4 comments

Comments

@Chakotay
Copy link

Chakotay commented Jan 13, 2025

I have been using pyright for code checking, but wanted to switch to pylsp or pylyzer. Using any of these other LSPs the symbols window opens and remains empty with this error message:

Error executing vim.schedule lua callback: ....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:1627: attempt to
concatenate local 'kind_display' (a nil value)
stack traceback:
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:1627: in function 'get_buf_lines_and_highlights'
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:1648: in function 'sidebar_get_buf_lines_and_highli
ghts'
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:1704: in function 'refresh_view'
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:1776: in function 'callback'
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:608: in function 'refresh_symbols'
...l/share/nvim/lazy/symbols.nvim/lua/symbols/providers.lua:185: in function 'handler'
...l/nvim-linux64/share/nvim/runtime/lua/vim/lsp/client.lua:687: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
Press ENTER or type command to continue

Clicking anywhere in the source code, another error message shows up:

Error detected while processing CursorMoved Autocommands for "*":
Error executing lua callback: ....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:1903: Cursor position outside buffer
stack traceback:
[C]: in function 'nvim_win_set_cursor'
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:1903: in function 'set_cursor_at_symbol'
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:2473: in function <....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:2462>
Press ENTER or type command to continue

Changed timeout, but same problem. Going back to pyright, things work normally.
Any idea why the plugin smashes with these LSPs?

@oskarrrrrrr
Copy link
Owner

Thanks for reporting that, I'll have a look.

@oskarrrrrrr
Copy link
Owner

The second issue should be fixed: c89c428

@oskarrrrrrr
Copy link
Owner

I can't reproduce the first issue. Pylyzer seems to be slow to respond and times out, pylsp works fine. Does the first error happen with any file?

@Chakotay
Copy link
Author

Chakotay commented Jan 14, 2025

The second issue is fixed. The first one is still present. If clicking back in the symbols pane, I get this slightly different message:

Error detected while processing CursorMoved Autocommands for "<buffer=18>":
Error executing lua callback: ....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:172: CursorMoved Autocommands for "<buffer=18>"..BufWinEnter
Autocommands for "*": Vim(append):Error executing lua callback: ....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:1627: attempt to concaten
ate local 'kind_display' (a nil value)
stack traceback:
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:1627: in function 'get_buf_lines_and_highlights'
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:1648: in function 'sidebar_get_buf_lines_and_highlights'
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:1704: in function 'refresh_view'
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:1776: in function 'callback'
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:608: in function <....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:596>
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:621: in function 'SymbolsRetriever_retrieve'
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:1797: in function 'refresh_symbols'
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:2799: in function <....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:279
[C]: in function 'nvim_open_win'
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:172: in function 'open'
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:202: in function 'on_cursor_move'
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:2388: in function 'on_cursor_move'
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:2460: in function <....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:246
stack traceback:
[C]: in function 'nvim_open_win'
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:172: in function 'open'
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:202: in function 'on_cursor_move'
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:2388: in function 'on_cursor_move'
....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:2460: in function <....local/share/nvim/lazy/symbols.nvim/lua/symbols/init.lua:246

I tried with md, lua, C, nvim, and tex files, plugin works as expected. The problem arises with py and ipynb files using pylsp, while pylyzer never gets running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants