Skip to content

bug: crash with Invalid window id after commit #128

@wbthomason

Description

@wbthomason

Did you check docs and existing issues?

  • I have read all the plugin docs
  • I have searched the existing issues
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.12.0-nightly+6c4ddf6

Operating system/version

Ubuntu 22.04.5

Describe the bug

After staging and committing changes in the status view, the following error raises, and the fugit2 UI becomes inaccessible:

vim.schedule callback: vim/_editor.lua:0: nvim_exec2(), line 7: Vim(call):E5555: API call: Invalid window id: 1029
stack traceback:
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function 'cmd'
	.../.local/share/nvim/lazy/nui.nvim/lua/nui/layout/init.lua:45: in function <.../.local/share/nvim/lazy/nui.nvim/lua/nui/layout/init.lua:42>
vim.schedule callback: ...on/.local/share/nvim/lazy/nui.nvim/lua/nui/tree/init.lua:261: Invalid 'window': Expected Lua number
stack traceback:
	[C]: in function 'nvim_win_get_cursor'
	...on/.local/share/nvim/lazy/nui.nvim/lua/nui/tree/init.lua:261: in function 'get_node'
	...ugit2.nvim/lua/fugit2/view/components/file_tree_view.lua:242: in function 'get_child_node_linenr'
	...are/nvim/lazy/fugit2.nvim/lua/fugit2/view/git_status.lua:1153: in function 'show_patch_for_current_file'
	...are/nvim/lazy/fugit2.nvim/lua/fugit2/view/git_status.lua:1112: in function 'callback'
	...are/nvim/lazy/fugit2.nvim/lua/fugit2/view/git_status.lua:1099: in function <...are/nvim/lazy/fugit2.nvim/lua/fugit2/view/git_status.lua:1096>

Steps To Reproduce

  1. Stage any change
  2. Write commit message, GPG signing enabled
  3. Commit with <ctrl-enter> from insert mode

Expected Behavior

The UI should not crash or become inaccessible. Seems like a window is being closed while there's still a reference to it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions