Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve view state when switching tabs on compare view #10663

Closed
ascendedguard opened this issue Aug 18, 2016 · 5 comments

Comments

@ascendedguard
Copy link

commented Aug 18, 2016

  • 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.

@ascendedguard ascendedguard changed the title Compare View loses scroll position Compare View loses scroll position when switching tabs Aug 18, 2016

@bpasero bpasero changed the title Compare View loses scroll position when switching tabs Only update diff editor scroll position when changes have been detected Aug 18, 2016

@bpasero bpasero added this to the Backlog milestone Aug 18, 2016

@ezk84

This comment has been minimized.

Copy link

commented Sep 21, 2017

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

@iestynne

This comment has been minimized.

Copy link

commented Sep 28, 2017

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

@29988122

This comment has been minimized.

Copy link

commented Jan 12, 2018

I agree. Never thought this could be a issue.

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

@pltrant

This comment has been minimized.

Copy link

commented Feb 21, 2018

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).

@bpasero bpasero changed the title Only update diff editor scroll position when changes have been detected Compare View loses scroll position when switching tabs Mar 25, 2018

bpasero added a commit that referenced this issue Apr 3, 2018

@bpasero bpasero self-assigned this Apr 3, 2018

@bpasero bpasero added this to the April 2018 milestone Apr 3, 2018

@bpasero bpasero closed this in 2e4bfdb Apr 3, 2018

@bpasero bpasero changed the title Compare View loses scroll position when switching tabs Preserve view state when switching tabs on compare view Apr 3, 2018

@bpasero

This comment has been minimized.

Copy link
Member

commented Apr 3, 2018

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

@isidorn isidorn added the verified label Apr 24, 2018

@vscodebot vscodebot bot locked and limited conversation to collaborators May 18, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.