Alexis12119 / nvim-config

Generalized and Personalized
267 stars 27 forks source link

bug: nvchad tabufline error when using lsp code action #15

Closed KevinNitroG closed 4 months ago

KevinNitroG commented 4 months ago

Hello again πŸ˜Άβ€πŸŒ«οΈ I have faced this issue many times whenever I use LSP code action, the tabufline will ... crash. I guess it's from NVChad tabufline's issue. I haven't tested on Linux yet. Currently, my Windows gets this error.

https://github.com/Alexis12119/nvim-config/assets/86353526/896ba2d2-7ed9-4215-b858-70fd1fac9455

Log from NoiceHistory:

6:49:37 PM msg_show stack traceback:
6:49:37 PM msg_show ^I[C]: in function 'buf_name'
6:49:37 PM msg_show ^I...-alexis12119-data/lazy/ui/lua/nvchad/tabufline/utils.lua:37: in function 'gen_unique_name'
6:49:37 PM msg_show ^I...-alexis12119-data/lazy/ui/lua/nvchad/tabufline/utils.lua:51: in function 'style_buf'
6:49:37 PM msg_show ^I...lexis12119-data/lazy/ui/lua/nvchad/tabufline/modules.lua:74: in function <...lexis12119-data/lazy/ui/lua/nvchad/tabufline/modules.lua:60>
6:49:37 PM msg_show ^I...lexis12119-data/lazy/ui/lua/nvchad/tabufline/modules.lua:117: in function <...lexis12119-data/lazy/ui/lua/nvchad/tabufline/modules.lua:107>
6:49:37 PM msg_show E15: Invalid expression: "v:lua.require('nvchad.tabufline.modules')()"
6:49:37 PM msg_show ...-alexis12119-data/lazy/ui/lua/nvchad/tabufline/utils.lua:37: Invalid buffer id: 15
6:49:37 PM msg_show stack traceback:
6:49:37 PM msg_show ^I[C]: in function 'buf_name'
6:49:37 PM msg_show ^I...-alexis12119-data/lazy/ui/lua/nvchad/tabufline/utils.lua:37: in function 'gen_unique_name'
6:49:37 PM msg_show ^I...-alexis12119-data/lazy/ui/lua/nvchad/tabufline/utils.lua:51: in function 'style_buf'
6:49:37 PM msg_show ^I...lexis12119-data/lazy/ui/lua/nvchad/tabufline/modules.lua:74: in function <...lexis12119-data/lazy/ui/lua/nvchad/tabufline/modules.lua:60>
6:49:37 PM msg_show ^I...lexis12119-data/lazy/ui/lua/nvchad/tabufline/modules.lua:117: in function <...lexis12119-data/lazy/ui/lua/nvchad/tabufline/modules.lua:107>
6:49:37 PM msg_show ^I[C]: in function 'nvim_exec2'
6:49:37 PM msg_show ^Ivim/_editor.lua:431: in function 'cmd'
6:49:37 PM msg_show ^I...s12119-data/lazy/nvim-notify/lua/notify/service/init.lua:63: in function 'push'
6:49:37 PM msg_show ^I...lexis12119-data/lazy/nvim-notify/lua/notify/instance.lua:77: in function <...lexis12119-data/lazy/nvim-notify/lua/notify/instance.lua:41>
6:49:37 PM msg_show ^I...9-data/lazy/noice.nvim/lua/noice/view/backend/notify.lua:169: in function '_notify'
6:49:37 PM msg_show ^I...9-data/lazy/noice.nvim/lua/noice/view/backend/notify.lua:199: in function 'show'
6:49:37 PM msg_show ^I...alexis12119-data/lazy/noice.nvim/lua/noice/view/init.lua:148: in function <...alexis12119-data/lazy/noice.nvim/lua/noice/view/init.lua:146>
6:49:37 PM msg_show ^I[C]: in function 'xpcall'
6:49:37 PM msg_show ^I...alexis12119-data/lazy/noice.nvim/lua/noice/util/call.lua:149: in function <...alexis12119-data/lazy/noice.nvim/lua/noice/util/call.lua:134>
6:49:37 PM msg_show ^I...alexis12119-data/lazy/noice.nvim/lua/noice/view/init.lua:154: in function 'display'
6:49:37 PM msg_show ^I...s12119-data/lazy/noice.nvim/lua/noice/message/router.lua:223: in function <...s12119-data/lazy/noice.nvim/lua/noice/message/router.lua:156>
6:49:37 PM msg_show ^I[C]: in function 'xpcall'
6:49:37 PM msg_show ^I...alexis12119-data/lazy/noice.nvim/lua/noice/util/call.lua:149: in function <...alexis12119-data/lazy/noice.nvim/lua/noice/util/call.lua:134>
6:49:37 PM msg_show ^I[C]: in function 'pcall'
6:49:37 PM msg_show ^I...alexis12119-data/lazy/noice.nvim/lua/noice/util/init.lua:146: in function 'fn'
6:49:37 PM msg_show ^Ivim/_editor.lua:599: in function 'fn'
6:49:37 PM msg_show ^Ivim/_editor.lua:351: in function <vim/_editor.lua:350>

Log in noice.log:

25/05/24 6:49:37 PM
vim/_editor.lua:431: nvim_exec2(): Vim(redraw):E15: Invalid expression: "v:lua.require('nvchad.tabufline.modules')()"

stack traceback:
    [C]: in function 'pcall'
    ...alexis12119-data/lazy/noice.nvim/lua/noice/util/call.lua:144: in function <...alexis12119-data/lazy/noice.nvim/lua/noice/util/call.lua:143>
    [C]: in function 'nvim_exec2'
    vim/_editor.lua:431: in function 'cmd'
    ...s12119-data/lazy/nvim-notify/lua/notify/service/init.lua:63: in function 'push'
    ...lexis12119-data/lazy/nvim-notify/lua/notify/instance.lua:77: in function <...lexis12119-data/lazy/nvim-notify/lua/notify/instance.lua:41>
    ...9-data/lazy/noice.nvim/lua/noice/view/backend/notify.lua:169: in function '_notify'
    ...
    [C]: in function 'xpcall'
    ...alexis12119-data/lazy/noice.nvim/lua/noice/util/call.lua:149: in function <...alexis12119-data/lazy/noice.nvim/lua/noice/util/call.lua:134>
    ...alexis12119-data/lazy/noice.nvim/lua/noice/view/init.lua:154: in function 'display'
    ...s12119-data/lazy/noice.nvim/lua/noice/message/router.lua:223: in function <...s12119-data/lazy/noice.nvim/lua/noice/message/router.lua:156>
    [C]: in function 'xpcall'
    ...alexis12119-data/lazy/noice.nvim/lua/noice/util/call.lua:149: in function <...alexis12119-data/lazy/noice.nvim/lua/noice/util/call.lua:134>
    [C]: in function 'pcall'
    ...alexis12119-data/lazy/noice.nvim/lua/noice/util/init.lua:146: in function 'fn'
    vim/_editor.lua:599: in function 'fn'
    vim/_editor.lua:351: in function <vim/_editor.lua:350>

PS: My NVIM_APPNAME = nvim-alexis12119

Alexis12119 commented 4 months ago

Looks like the tabufline is enabled there.

Alexis12119 commented 4 months ago

You have this autocmd?

https://github.com/Alexis12119/nvim-config/blob/main/lua/core/autocommands.lua#L81-L87

Alexis12119 commented 4 months ago

Also, I wanna ask this question. Are you in the Discord Server of NvChad? If not, you can join there if you want.

Alexis12119 commented 4 months ago

For me, this is the error I have since my tabufline is always disabled which is on the lspsaga.nvim side.

Error executing lua callback: ...ocal/share/nvim/lazy/lspsaga.nvim/lua/lspsaga/window.lua:157: 'height' key must be a positive Integer
stack traceback:
    [C]: in function 'nvim_open_win'
    ...ocal/share/nvim/lazy/lspsaga.nvim/lua/lspsaga/window.lua:157: in function 'new_float'
    ...vim/lazy/lspsaga.nvim/lua/lspsaga/codeaction/preview.lua:141: in function 'create_preview_win'
    ...vim/lazy/lspsaga.nvim/lua/lspsaga/codeaction/preview.lua:166: in function 'action_preview'
    ...e/nvim/lazy/lspsaga.nvim/lua/lspsaga/codeaction/init.lua:227: in function 'set_cursor'
    ...e/nvim/lazy/lspsaga.nvim/lua/lspsaga/codeaction/init.lua:101: in function <...e/nvim/lazy/lspsaga.nvim/lua/lspsaga/codeaction/init.lua:100>
Alexis12119 commented 4 months ago

One thing I can do is use the native lsp way for code action and not lspsaga.

:lua=vim.lsp.buf.code_action()

or use this commit 898030df423a527c55a6fd85e85e58e840ff6e82 and make sure you copied my autocmd for disabling tabufline.

Alexis12119 commented 4 months ago

I really need to sleep now cause I have something to do again tomorrow.

KevinNitroG commented 4 months ago

I really need to sleep now cause I have something to do again tomorrow.

Alright have a good sleep ✨ and do well tomorrow πŸ’―

KevinNitroG commented 4 months ago

You have this autocmd?

main/lua/core/autocommands.lua#L81-L87

I disabled that autocmd to show the tabline ((:

Alexis12119 commented 4 months ago

You have this autocmd?

main/lua/core/autocommands.lua#L81-L87

I disabled that autocmd to show the tabline ((:

Sorry, there's a typhoon that's why i didn't respond quickly.

Alexis12119 commented 4 months ago

You have this autocmd? main/lua/core/autocommands.lua#L81-L87

I disabled that autocmd to show the tabline ((:

Then, the NvChad issue should be fix.

KevinNitroG commented 4 months ago

You have this autocmd? main/lua/core/autocommands.lua#L81-L87

I disabled that autocmd to show the tabline ((:

Sorry, there's typhoon that's why i didn't respond quickly.

Hope you will be alright. In my place, the weather is very hot πŸ₯΅ I would be happy if you can send me some rain 🐧

Alexis12119 commented 4 months ago

You can join the server and tell siduck the issue you're facing.

Alexis12119 commented 4 months ago

I noticed that it's only occuring when the code action has preview.

Alexis12119 commented 4 months ago

I'll close this one since this issue is on the NvChad side.