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

Stack trace on each kulala.nvim UI window close #441

Open
daniel-odrinski opened this issue Mar 10, 2025 · 16 comments · Fixed by #444
Open

Stack trace on each kulala.nvim UI window close #441

daniel-odrinski opened this issue Mar 10, 2025 · 16 comments · Fixed by #444

Comments

@daniel-odrinski
Copy link

14:23:50 msg_show.lua_print ....local/share/nvim/lazy/ui/lua/nvchad/tabufline/utils.lua:38: Invalid buffer id: 240
stack traceback:
	[C]: in function 'buf_name'
	....local/share/nvim/lazy/ui/lua/nvchad/tabufline/utils.lua:38: in function 'gen_unique_name'
	....local/share/nvim/lazy/ui/lua/nvchad/tabufline/utils.lua:53: in function 'style_buf'
	...ocal/share/nvim/lazy/ui/lua/nvchad/tabufline/modules.lua:80: in function <...ocal/share/nvim/lazy/ui/lua/nvchad/tabufline/modules.lua:66>
	...ocal/share/nvim/lazy/ui/lua/nvchad/tabufline/modules.lua:123: in function <...ocal/share/nvim/lazy/ui/lua/nvchad/tabufline/modules.lua:113>
	[C]: at 0x0102f82a78
	[C]: in function 'pcall'
	.../share/nvim/lazy/nvim-notify/lua/notify/windows/init.lua:321: in function '_advance_win_state'
	.../share/nvim/lazy/nvim-notify/lua/notify/windows/init.lua:181: in function '_update_window'
	.../share/nvim/lazy/nvim-notify/lua/notify/windows/init.lua:37: in function <.../share/nvim/lazy/nvim-notify/lua/notify/windows/init.lua:30>
	[C]: in function 'pcall'
	...
	[C]: in function 'xpcall'
	...local/share/nvim/lazy/noice.nvim/lua/noice/util/call.lua:149: in function <...local/share/nvim/lazy/noice.nvim/lua/noice/util/call.lua:134>
	...local/share/nvim/lazy/noice.nvim/lua/noice/view/init.lua:170: in function 'display'
	.../share/nvim/lazy/noice.nvim/lua/noice/message/router.lua:214: in function <.../share/nvim/lazy/noice.nvim/lua/noice/message/router.lua:147>
	[C]: in function 'xpcall'
	...local/share/nvim/lazy/noice.nvim/lua/noice/util/call.lua:149: in function <...local/share/nvim/lazy/noice.nvim/lua/noice/util/call.lua:134>
	[C]: in function 'pcall'
	...local/share/nvim/lazy/noice.nvim/lua/noice/util/init.lua:146: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>

What happens?
kulala.nvim has a UI window which can be closed once done with it. Each time I close it, I get the above stack trace and the tabufline breaks completely.

I am closing the window using the plugin's built-in keymap 'q', so it is not like I am closing this window in any improper way.

Neovim version:

NVIM v0.11.0-dev-1684+g0c8890e7a7
Build type: RelWithDebInfo
LuaJIT 2.1.1736781742
@siduck
Copy link
Member

siduck commented Mar 10, 2025

can you show a video?

@siduck
Copy link
Member

siduck commented Mar 10, 2025

and your settings for that plugin

@daniel-odrinski
Copy link
Author

daniel-odrinski commented Mar 13, 2025

@siduck Please find the requested information below.

Screen.Recording.2025-03-13.at.09.57.54.mov

I disabled noice.nvim just to eliminate it from the picture. Here is the new stack trace:

Errors in request localhost:8081/test at line: 2
* Host localhost:8081 was resolved.
....local/share/nvim/lazy/ui/lua/nvchad/tabufline/utils.lua:38: Invalid buffer id: 10
stack traceback:
	[C]: in function 'buf_name'
	....local/share/nvim/lazy/ui/lua/nvchad/tabufline/utils.lua:38: in function 'gen_unique_name'
	....local/share/nvim/lazy/ui/lua/nvchad/tabufline/utils.lua:53: in function 'style_buf'
	...ocal/share/nvim/lazy/ui/lua/nvchad/tabufline/modules.lua:80: in function <...ocal/share/nvim/lazy/ui/lua/nvchad/tabufline/modules.lua:66>
	...ocal/share/nvim/lazy/ui/lua/nvchad/tabufline/modules.lua:123: in function <...ocal/share/nvim/lazy/ui/lua/nvchad/tabufline/modules.lua:113>
E15: Invalid expression: "v:lua.require('nvchad.tabufline.modules')()"
Errors in request localhost:8081/test at line: 2
* Host localhost:8081 was resolved.

Plugin settings:

  {
    "mistweaverco/kulala.nvim",
    opts = {
      default_view = "headers_body",
    },
  },

@siduck
Copy link
Member

siduck commented Mar 14, 2025

i will test it tomorrow 👍

@daniel-odrinski
Copy link
Author

daniel-odrinski commented Mar 14, 2025

Thank you very much 🙂

@siduck
Copy link
Member

siduck commented Mar 14, 2025

vim.api.nvim_create_autocmd("BufAdd" , {
  callback = function(args)
    vim.print{args.buf, vim.bo[args.buf].ft}
  end,
})

@mistweaverco do you use eventignore for your plugin? i dont see it at bufdelete event, weird

@glmlm
Copy link
Contributor

glmlm commented Mar 15, 2025

Here is the new stack trace:

@daniel-odrinski Could you please update the ui plugin to the latest version and try the same thing again?
I have recently fixed a similar issue(#442), so so it is possible that the problem has already been resolved.

@siduck
Copy link
Member

siduck commented Mar 15, 2025

@glmlm its not related to that

{
    "mistweaverco/kulala.nvim",
    lazy = false,
    opts = {},
  }

and then run

:lua require("kulala").open()

and go to that window, press q

@daniel-odrinski
Copy link
Author

@glmlm Can confirm that your fix does not fix this issue.

@glmlm
Copy link
Contributor

glmlm commented Mar 16, 2025

@siduck @daniel-odrinski It appears that the issue is due to the buffer number nr of kulala.nvim being left in the vim.t.bufs. I'm investigating the cause little by little, but I'm afraid I cannot help you at the moment.

@daniel-odrinski
Copy link
Author

Thank you so much for your help @glmlm @siduck

@glmlm
Copy link
Contributor

glmlm commented Mar 17, 2025

@daniel-odrinski Could you please test my PR? This might solve the issue.

@siduck If you wouldn't mind confirming that this implementation is correct, I would be very grateful. I must admit that I have not read all of the code, so I am not sure if this is appropriate.

@daniel-odrinski
Copy link
Author

Will do @glmlm thanks :)

@siduck
Copy link
Member

siduck commented Mar 17, 2025

@siduck @daniel-odrinski It appears that the issue is due to the buffer number nr of kulala.nvim being left in the vim.t.bufs. I'm investigating the cause little by little, but I'm afraid I cannot help you at the moment.

i know, the bufdelete even handler must remove it but idk how it ignores

@daniel-odrinski
Copy link
Author

@glmlm @siduck I am happy to report that this fix works :) Thank you so much!

@siduck
Copy link
Member

siduck commented Mar 24, 2025

dont close yet, i'll come back to this issue in few weeks and merge the code to main branch

@siduck siduck reopened this Mar 24, 2025
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

Successfully merging a pull request may close this issue.

3 participants