Merge editor: restore original contents if aborting and allow to undo
See original GitHub issueThis issue is 2 issues but closely related: how to get back to the workspace file contents after closing the merge editor without having resolved the conflict. The setup is:
- have the conflicting workspace file opened as a text editor
- then open the merge editor for it
I think this setup will be common because users would most likely first see the workspace file in a text editor with the git merge markers before deciding to use the merge editor.
Auto Save: ON
In this case the user should not see a dialog asking to revert the changes back but I think as we had discussed allowing to run the Undo
command in the text editor would be nice to get the model at the contents how they were.
Auto Save: OFF Assuming the user has not saved the merge editor yet (i.e. the dirty indicator shows), closing the merge editor and picking “Do not save” should ideally restore the workspace file text editor as it was:
- if the editor was dirty, restore the buffer and show the editor dirty
[1]
- if the editor was saved, restore the contents from disk
Does that make sense? I wonder how weird [1]
would be given that after clicking “Do not save” the workspace file would show as dirty again, but I think it makes sense to restore it how it was.
//cc @isidorn @daviddossett
Issue Analytics
- State:
- Created a year ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
At the moment, the merge editor saves the content of result before it opens. (same as F5 saves the current file)
I’ll move this issue to October, as it seems to be under discussion. Please create seperate issues for concrete actionables if you want to have them addressed this milestone.
I like your idea of saving before opening the merge editor, I think that is solving the corner case quite well.