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

Merge editor: preserve view state #150804

Closed
bpasero opened this issue May 31, 2022 · 5 comments · Fixed by #153315
Closed

Merge editor: preserve view state #150804

bpasero opened this issue May 31, 2022 · 5 comments · Fixed by #153315
Assignees
Labels
feature-request Request for new features or functionality merge-editor merge-editor-workbench verification-needed Verification of issue is requested verified Verification succeeded workbench-state UI state across restarts
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented May 31, 2022

Testing #150389

Similar to #150791 where BaseTextEditor provides some helper methods for storing editor view state, the merge editor should associate view state like the diff editor does: e.g. selection, folding regions etc. so that they can restore after window reload.

One thing that is special about the diff editor: when you open a diff editor for the first time, we automatically reveal the first diff and ignore any previous view state. This helps focussing on what has actually changed. However, when a diff editor was opened before and is just made active again, we do restore the view state.

@hediet hediet added feature-request Request for new features or functionality merge-editor labels May 31, 2022
@hediet hediet added this to the June 2022 milestone May 31, 2022
@bpasero bpasero self-assigned this Jun 12, 2022
@bpasero bpasero added the workbench-state UI state across restarts label Jun 12, 2022
@vscodenpa vscodenpa added the unreleased Patch has not yet been released in VS Code Insiders label Jun 27, 2022
@jrieken jrieken added the verification-needed Verification of issue is requested label Jun 27, 2022
@jrieken
Copy link
Member

jrieken commented Jun 27, 2022

To verify:

  • open merge editor
  • select something in input1, show the find widget in input2, etc
  • reload the window or close/reopen the editor
  • ensure that the view state is restored

To get a merge conflict and editor

  • use this setting "git.mergeEditor": true
  • run the commands below
  • open the conflict from the SCM view
git clone https://github.com/hediet/vscode-3wm-test-repo.git
cd vscode-3wm-test-repo
git fetch --all
git checkout input1
git merge input2

@vscodenpa vscodenpa added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jun 28, 2022
@isidorn
Copy link
Contributor

isidorn commented Jun 28, 2022

I can still reproduce this, reopening. I am following steps from the above comment. Here's a gif:

Recording 2022-06-28 at 20 21 23

@isidorn isidorn reopened this Jun 28, 2022
@vscodenpa vscodenpa removed the insiders-released Patch has been released in VS Code Insiders label Jun 28, 2022
@jrieken
Copy link
Member

jrieken commented Jun 29, 2022

Sorry forgot to mention that it needs todays insiders.

@jrieken jrieken closed this as completed Jun 29, 2022
@jrieken jrieken reopened this Jun 29, 2022
@jrieken
Copy link
Member

jrieken commented Jun 29, 2022

Still doesn't work... Need to investigate., sorry for the fuzz

@jrieken jrieken closed this as completed Jun 29, 2022
@jrieken
Copy link
Member

jrieken commented Jun 29, 2022

Sorry, my verification steps are bad. The find widget isn't part of any editor view state, selecting and folding etc is. So

To verify:

  • open merge editor
  • select something in input1, select something in input2, fold something input3
  • reload the window or close/reopen the editor
  • ensure that the view state is restored

@connor4312 connor4312 added the verified Verification succeeded label Jun 29, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Aug 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality merge-editor merge-editor-workbench verification-needed Verification of issue is requested verified Verification succeeded workbench-state UI state across restarts
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants