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 the revealed area after using "Open File" from git-diff editor (fix #53465) #54867

Merged
merged 2 commits into from Sep 12, 2018

Conversation

Projects
None yet
2 participants
@Hirico
Contributor

Hirico commented Jul 23, 2018

Ref: #53465.

@Hirico Hirico changed the title from Reserve the revealed area after using "Open File" from git-diff editor (fix #53465) to Preserve the revealed area after using "Open File" from git-diff editor (fix #53465) Jul 23, 2018

Fix a compiler error
I didn't notice the preservation should be put under a condition
@Hirico

This comment has been minimized.

Show comment
Hide comment
@Hirico

Hirico Jul 24, 2018

Contributor

Effect gif:
effect

As you can see, both cursor position and view position are preserved now.

Limitations:

  1. I didn't change what would happen when you first open the diff editor (so in that scenario, previous view position is still ignored). Intuitively, when you invoke command "Git: Open Changes", the view position should be preserved, too. I didn't do it because I'm not quite sure of requirements on that.

  2. I use editor.visibleRanges to get previous view position, and there is an issue on that. If you put the cursor on the left column, and then click "Open File", the view position (of the opened right file) will follow the line numbers of the left column, leading you to a strange position. I guess we can change visibleRanges implementation of DiffEditor for this?

Contributor

Hirico commented Jul 24, 2018

Effect gif:
effect

As you can see, both cursor position and view position are preserved now.

Limitations:

  1. I didn't change what would happen when you first open the diff editor (so in that scenario, previous view position is still ignored). Intuitively, when you invoke command "Git: Open Changes", the view position should be preserved, too. I didn't do it because I'm not quite sure of requirements on that.

  2. I use editor.visibleRanges to get previous view position, and there is an issue on that. If you put the cursor on the left column, and then click "Open File", the view position (of the opened right file) will follow the line numbers of the left column, leading you to a strange position. I guess we can change visibleRanges implementation of DiffEditor for this?

@joaomoreno joaomoreno added this to the Backlog milestone Aug 2, 2018

@joaomoreno joaomoreno added the git label Aug 2, 2018

@joaomoreno

This comment has been minimized.

Show comment
Hide comment
@joaomoreno

joaomoreno Sep 12, 2018

Member

Thanks! 🍻

Member

joaomoreno commented Sep 12, 2018

Thanks! 🍻

@joaomoreno joaomoreno merged commit 24d9eeb into Microsoft:master Sep 12, 2018

2 checks passed

VSTS: VS Code 20180724.34 succeeded with issues
Details
license/cla All CLA requirements met.

@joaomoreno joaomoreno modified the milestones: Backlog, September 2018 Sep 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment