nvimdev / lspsaga.nvim

improve neovim lsp experience
MIT License
3.47k stars 288 forks source link

When outline is shown, every time I close a buffer, I got this error. #1499

Open liujoey opened 3 hours ago

liujoey commented 3 hours ago

Describe the bug

Using Astronvim, when ever I close a buff, I got this error.

Error executing vim.schedule lua callback: ...re/nvim/lazy/lspsaga.nvim/lua/lspsaga/symbol/outline.lua:203: Invalid 'buffer': Expected Lua number
stack traceback:
    [C]: in function 'nvim_buf_delete'
    ...re/nvim/lazy/lspsaga.nvim/lua/lspsaga/symbol/outline.lua:203: in function ''
    vim/_editor.lua: in function ''
    vim/_editor.lua: in function <vim/_editor.lua:0>

Steps to reproduce

Using Astronvim with community lspsaga receipt, when I have the outline opened, and try to close a java buffer, I got the error.

Expected behavior

If the closed buffer is not the last buffer, the lspsaga outline should keep showing the outline for the current buff. If its the last buff, then I guess we should close the outline as well?

Neovim version (nvim -v)

0.10.0

lspsaga commit

d027f8b

Terminal name/version

western

liujoey commented 3 hours ago

The terminal is Wezterm, damn the auto-correction.

liujoey commented 2 hours ago

If I close the outline first, and then delete a buffer, I got this:

14:36:35 msg_show.echomsg (mini.bufremove) vim/_editor.lua:0: nvim_exec2(): Vim(bdelete):Error executing lua callback: ...re/nvim/lazy/lspsaga.nvim/lua/lspsaga/symbol/outline.lua:201: Invalid 'window': Expected Lua number
stack traceback:
    [C]: in function 'nvim_win_is_valid'
    ...re/nvim/lazy/lspsaga.nvim/lua/lspsaga/symbol/outline.lua:201: in function <...re/nvim/lazy/lspsaga.nvim/lua/lspsaga/symbol/outline.lua:198>
    [C]: in function 'nvim_exec2'
    vim/_editor.lua: in function <vim/_editor.lua:0>
    [C]: in function 'pcall'
    ...al/share/nvim/lazy/mini.bufremove/lua/mini/bufremove.lua:234: in function 'func'
    ...local/share/nvim/lazy/astrocore/lua/astrocore/buffer.lua:153: in function 'mini_confirm'
    ...local/share/nvim/lazy/astrocore/lua/astrocore/buffer.lua:162: in function 'close'
    .../AstroNvim/lua/astronvim/plugins/_astrocore_mappings.lua:78: in function <.../AstroNvim/lua/astronvim/plugins/_astrocore_mappings.lua:78>