Creating permalink with shortcut key "y" points to wrong file

Summary

When looking at a file in the GitLab UI, you can type "y" to create a permalink to the file you are viewing, if you have previously looked at another file in the repo, you will get a permalink to the previous file instead of the current file.

Steps to reproduce

  1. Go to https://gitlab.com/mikaello/bs-pixl-xml
  2. Click on the file package.json
  3. Navigate back to previous page (e.g. by using the previous page button in your browser)
  4. Click on the file bsconfig.json
  5. Type y on your keyboard
  6. Notice that you got a permalink in the address bar to package.json, not the file you are looking at

If you click a line before typing y, you will get the correct line number when typing y, but still the previous file.

What is the current bug behavior?

Permalinks created by typing y points to wrong file.

What is the expected correct behavior?

Permalinks created by typing y should be to the file you are viewing

Edited by mikaello