Vscode: Preserve view state when switching tabs on compare view

Created on 18 Aug 2016  路  5Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.4.0
  • OS Version: Windows 10 Version 1607

When you are comparing two tabs, and click on another tab and come back, the scroll position is lost and you end up at the top of the file. In my use case, I'm comparing SQL scripts and have an additional tab for manually creating a merge script. When I come back to the compare, I've lost my position.

While it looks like it's refreshing the comparison when you tab back, it seems like it could be a little more intelligent in either remembering the scroll position, or only refreshing if one of the two compared files has been modified.

Steps to Reproduce:

  1. Open two tabs.
  2. >Files: Compare active file with...
  3. Scroll down on compare
  4. Click to another tab
  5. Click back to the compare tab
  6. Notice that scroll position has been lost.
diff-editor feature-request verification-needed verified workbench-editors

Most helpful comment

Pushed a fix without introducing a new extra setting, lets try it out in insiders and see how it goes. The new behaviour is that the view state is always preserved and restored as long as the diff editor is not closed.

Verify:

  • open a diff editor (e.g. from SCM outgoing changes)
  • set some view state (scroll, selection, folding)
  • go to another editor
  • go back and view state is restored
  • close diff editor
  • open it again and verify the first diff is revealed

All 5 comments

I'm experiencing this! Any updates on when there'll be a fix :)

Editing code in the diff view is my primary workflow, so this bug makes VS-code basically unusable for me :o(

I agree. Never thought this could be a issue.

Currently using notepad++ , really need this feature to be implemented.

This is a very annoying bug. For other users, as a workaround, you can open a new window of VSCode to reference the diff editor against (to avoid changing tabs).

Pushed a fix without introducing a new extra setting, lets try it out in insiders and see how it goes. The new behaviour is that the view state is always preserved and restored as long as the diff editor is not closed.

Verify:

  • open a diff editor (e.g. from SCM outgoing changes)
  • set some view state (scroll, selection, folding)
  • go to another editor
  • go back and view state is restored
  • close diff editor
  • open it again and verify the first diff is revealed
Was this page helpful?
0 / 5 - 0 ratings