microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.2k stars 29.29k forks source link

Clicking Back Button Goes to Wrong Screen #137738

Closed simarssidhu closed 2 years ago

simarssidhu commented 2 years ago

Hi there VSCode,

When working on code, especially lengthy ones, I often split one file left and right (i.e. beginning of "fizzbuzz.c" file on the left, end of "fizzbuzz.c" on the right), as opposed to scrolling between the two ends on one file. If I am on the left tab and double-click the "fizzbuzz.c" tab on top, it will split the screen with 90% on the left side and 10% on the right. If I click on the right side of the screen, the other split file will fill the space instead, with 10% on the left side, and 90% on the right. This is an excellent feature.

Now, say I am on the left split screen, and I right-click a struct, click on "Go to Definition", it will open up the "fizzbuzz.h" file and highlight the struct, all on the left split screen. Now when I click the "back" button on my mouse (there is a forward and back button on my mouse that normally takes me back to what I was clicking before, i.e. the struct in "fizzbuzz.c" on the left split screen in this case"), it expands the right split screen and highlights the struct in "fizzbuzz.c" on the right split screen. If I click the the "back" button again, it returns to the "fizzbuzz.h" file on the left split screen. Also, my right split screen changed its position from the end to the beginning, and I have to readjust to fix it again. This is unintuitive and annoying, and bogs me down.

In short, to reproduce (using fizzbuzz.c as example):

  1. Open "fizzbuzz.c" file in VSCode.
  2. Right-click "fizzbuzz.c" tab on top -> click on "Split Right".
  3. Double-click "fizzbuzz.c" tab on left split screen. Screen should now be ~90/10 split.
  4. Right-click on struct in "fizzbuzz.c" -> click on "Go to Definition. Left screen should now open new tab called "fizzbuzz.h" with struct highlighted.
  5. Click the "back" button on the mouse. "fizzbuzz.c" will open on the right split screen with struct highlighted. Screen is now a ~10/90 split.

Actual Results:

Expected Results:

This bug can be reproduced 100% of the time with the above steps. I have tried it on several files, and several computers as well. Hope this helps to squash it. Sorry, I don't know markdown, but if you need more info, please let me know and I will gladly provide.

Thank you, Simar

bpasero commented 2 years ago

/duplicate https://github.com/microsoft/vscode/issues/9526