Skip to content

Conversation

@Hirico
Copy link
Contributor

@Hirico Hirico commented Jul 23, 2018

Ref: #53465.

@Hirico Hirico changed the title Reserve the revealed area after using "Open File" from git-diff editor (fix #53465) Preserve the revealed area after using "Open File" from git-diff editor (fix #53465) Jul 23, 2018
I didn't notice the preservation should be put under a condition
@Hirico
Copy link
Contributor Author

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 GIT issues label Aug 2, 2018
@joaomoreno
Copy link
Member

Thanks! 🍻

@joaomoreno joaomoreno merged commit 24d9eeb into microsoft:master Sep 12, 2018
@joaomoreno joaomoreno modified the milestones: Backlog, September 2018 Sep 12, 2018
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

git GIT issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants