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
Closed

Preserve view state when switching tabs on compare view #10663

ascendedguard opened this issue Aug 18, 2016 · 5 comments
Assignees
Labels
diff-editor Diff editor mode issues feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded workbench-editors Managing of editor widgets in workbench window
Milestone

Comments

@ascendedguard
Copy link

  • 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 feature-request Request for new features or functionality file-explorer Explorer widget issues labels Aug 18, 2016
@bpasero bpasero added this to the Backlog milestone Aug 18, 2016
@ezk84
Copy link

ezk84 commented Sep 21, 2017

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

@iestynne
Copy link

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

@bpasero bpasero added diff-editor Diff editor mode issues workbench-editors Managing of editor widgets in workbench window and removed file-explorer Explorer widget issues labels Nov 27, 2017
@bpasero bpasero removed this from the Backlog milestone Nov 27, 2017
@29988122
Copy link

I agree. Never thought this could be a issue.

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

@pltrant
Copy link

pltrant 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 bpasero self-assigned this Apr 3, 2018
@bpasero bpasero added this to the April 2018 milestone Apr 3, 2018
@bpasero bpasero closed this as completed 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
Copy link
Member

bpasero 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

@bpasero bpasero added the verification-needed Verification of issue is requested label Apr 11, 2018
@isidorn isidorn added the verified Verification succeeded 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.
Labels
diff-editor Diff editor mode issues feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded workbench-editors Managing of editor widgets in workbench window
Projects
None yet
Development

No branches or pull requests

7 participants