Skip to content

Bug: Creating Note Outside Reviewer Throws Error (Note Creates Successfully) #437

@harrisoncramer

Description

@harrisoncramer

Bug Description

When creating a note before the reviewer pane is opened you see this error:

Error executing vim.schedule lua callback: ...v-plugins/gitlab/lua/gitlab/actions/discussions/tree.lua:457: Invalid 'window': Expected Lua number
stack traceback:
	[C]: in function 'nvim_win_set_cursor'
	...v-plugins/gitlab/lua/gitlab/actions/discussions/tree.lua:457: in function 'restore_cursor_position'
	...v-plugins/gitlab/lua/gitlab/actions/discussions/init.lua:498: in function 'rebuild_unlinked_discussion_tree'
	...v-plugins/gitlab/lua/gitlab/actions/discussions/init.lua:47: in function 'callback'
	...v-plugins/gitlab/lua/gitlab/actions/discussions/init.lua:66: in function 'cb'
	...mer/.config/nvim/dev-plugins/gitlab/lua/gitlab/state.lua:626: in function 'callback'
	...ramer/.config/nvim/dev-plugins/gitlab/lua/gitlab/job.lua:44: in function ''

This is occurring because the discussion tree may not be open, it's an error on line 457 of tree.lua where we attempt to set the window cursor.

Reproduction Steps

Create a note, before opening the reviewer pane.

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