Skip to content

Undo text not working when focus is in file explorer #111630

Closed

Description

Testing #111015

  • In the VSCode repo, open src/vs/nls.build.js
  • add some content on the first line, save
  • in the file explorer rename the file to nls.build.js1
  • from the window menu, run Edit > Undo. File is renamed back ✔️
  • from the window menu, run Edit > Undo. Nothing happens, content change is not undone
  • but the focus in the editor, then undo works

Activity

  1. changed the title [-]Undo text after undo file name not wodking[/-] [+]Undo text after undo file name not working[/+] on Dec 1, 2020
  2. isidorn commented on Dec 1, 2020

    @isidorn

    We have decide to behave like this -> if focus is in explorer we do not undo the changes done in the editor.
    We can easily change this, though I would like to gather more feedback before chaning anything here. Thus assigning to December and debt week.

  3. added
    file-explorer
    under-discussion
    undo-redo
    on Dec 1, 2020
  4. changed the title [-]Undo text after undo file name not working[/-] [+]Undo text not working when focus is in file explorer[/+] on Dec 2, 2020
  5. alexdima commented on Dec 2, 2020

    @alexdima
    Member

    I've changed the title to reflect easier repro steps:

    • type in editor
    • click in explorer
    • try to undo
  6. isidorn commented on Jan 15, 2021

    @isidorn

    The only negative feedback regarding undo is this issue #112706

    Making the undo stack "shared" between the explorer and editor does not make a lot of sense to me since it is not really complementery with the current approach of each editor having it's own undo stack.

    The only thing I would consider changing is: if the Explorer has no undo stack, then pressing undo when focus is in the Explorer would undo in the editor. Alexandru Dima (@alexdima) what do you think?

  7. alexdima commented on Jan 15, 2021

    @alexdima
    Member

    The only negative feedback regarding undo is this issue #112706

    Isidor Nikolic (@isidorn) I agree that we should prompt for destructive undos. Is that something I need to help you with or can you do it outside the undo redo service?

    if the Explorer has no undo stack, then pressing undo when focus is in the Explorer would undo in the editor

    I like this idea. I think you can do it on your side by doing something like this e.g.

    image

  8. added
    unreleased
    on Jan 18, 2021
  9. isidorn commented on Jan 18, 2021

    @isidorn

    Alexandru Dima (@alexdima) thanks. I just tried that and works as expected. Thus I pushed and closing this one since I would do no other changes here.

    As for the prompt for desctructive undo, I think I can handle it from the DeleteOperation that is an undo.
    I will create a PR to tackle that and we can continue the discussion #112706

  10. added
    bug
    on Jan 18, 2021
  11. isidorn commented on Jan 18, 2021

    @isidorn

    Adding bug label so we get this verified, steps:

    • Reload vscode
    • Do some edits in the editor
    • Focus the explorer, press cmd + Z, the editor should undo
  12. isidorn commented on Jan 18, 2021

    @isidorn

    Alexandru Dima (@alexdima) on second thought I just remembered that the UndoRedoService already has a check here

    So if I implement this in the DeleteOperation I might be duplicating code.
    However I see that the UndoRedoService is unaware of what kind of an operation it is.

    To sum it up I suggest:

    • Let's remove the check from the UndoRedoService
    • And have only a check in the DeleteOperation. That should catch both the new case, and the original case for which you introduced the check in the UndoRedoService

    Let me know what you think

    fyi Johannes Rieken (@jrieken) we are discussing to introduce a prompt before destructive undo operation. I am not sure if it would be a problem to prompt before all undo DeleteOperations. I would have a "Do not show again" checkbox.

  13. added a commit that references this issue on Jan 18, 2021
    073f423
  14. added
    insiders-released
    and removed
    unreleased
    on Jan 19, 2021
  15. added a commit that references this issue on Feb 6, 2021
    afd102c
  16. locked and limited conversation to collaborators on Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugfile-explorerinsiders-releasedunder-discussionundo-redoverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions