Skip to content

Jumping to wrong file when file has been moved #451

@jakubbortlik

Description

@jakubbortlik

Prerequsities

  • I'm on the latest version of the plugin
  • I've installed the required dependencies
  • I've run :h gitlab.nvim.troubleshooting and followed the steps there

Bug Description

When a file with a comment is renamed/moved, the jump_to_reviewer action in the discussion tree jumps to the last selected file instead which can be confusing for users.

Reproduction Steps

  1. Check out the feature branch
  2. Open Neovim
  3. Start gitlab.nvim review
  4. Make a comment on a line
  5. Rename the file with the comment, git add & commit & push
  6. Local the comment in the discussion tree and press the Jump to reviewer keybinding.

Possible fix

This is easy to fix by checking whether a file has been selected in gitlab.nvim/lua/gitlab/reviewer/init.lua line 120-122. If not, show a warning and do not jump to the reviewer. I've got this working in a feature branch, so I can prepare a PR.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions