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

Redo drop does not work for single file #111639

Closed
aeschli opened this issue Dec 1, 2020 · 6 comments
Closed

Redo drop does not work for single file #111639

aeschli opened this issue Dec 1, 2020 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug file-explorer Explorer widget issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Milestone

Comments

@aeschli
Copy link
Contributor

aeschli commented Dec 1, 2020

Testing #111015

Ubuntu

  • In the Ubuntu file explorer, select a file a drop in the VSCode explorer
  • from the window menu, run Edit > Undo. Copy is undone ✔️
  • from the window menu, run Edit > Redo. Nothing happens

Interestingly, dropping 2 files and undo - redo works

@aeschli aeschli changed the title Redo drop does not work Redo drop does not work for single file Dec 1, 2020
@isidorn isidorn added the file-explorer Explorer widget issues label Dec 1, 2020
@isidorn isidorn added this to the November 2020 milestone Dec 1, 2020
@isidorn
Copy link
Contributor

isidorn commented Dec 2, 2020

For me I see something differently. In the last step the Redo works, however the file is brough back empty.

This is due to the fact that we pass true here as the _undoesCreateOperation

return this._instaService.createInstance(DeleteOperation, this.newUri, this.options, { isUndoing: true }, true);

I have verified that passing false here actually fixes the issue.
Though I know @jrieken introduced this flag for a reason. Thus also assigning this issue to him

@jrieken
Copy link
Member

jrieken commented Dec 2, 2020

@isidorn Using false should be OK for that case. Basically that is there to know if delete in undoing a create operation. Create should be understood as "create empty file", not as copy or as re-create after delete.

@jrieken jrieken added the bug Issue identified by VS Code Team member as probable bug label Dec 2, 2020
@isidorn isidorn closed this as completed in 49ef641 Dec 2, 2020
@isidorn
Copy link
Contributor

isidorn commented Dec 2, 2020

@jrieken thanks. Pushed that fix then
@aeschli I understand I did not fix 100% the issue you were seeing, but a similar issue. However still closing this, and you can try with latest out of source and let me know if you still see something strange. I believe your original issue was also connected to the focus and is basically a dupe of #111640

@jrieken
Copy link
Member

jrieken commented Dec 2, 2020

Thanks @isidorn. This is why all of this is so complicated: #107379. The gist is that undo of create should only restore contents when create was invoked with contents, not if the contents came later. Using your changes I have re-verified #107379 and things are happy

@isidorn
Copy link
Contributor

isidorn commented Dec 2, 2020

Thanks for re-verifiying.

@aeschli aeschli added the verified Verification succeeded label Dec 4, 2020
@aeschli
Copy link
Contributor Author

aeschli commented Dec 4, 2020

Verified that setting the focus on the explorer solves the issue.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug file-explorer Explorer widget issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants
@jrieken @isidorn @aeschli and others