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

Inconsistent undo/redo behavior in Ctrl-F field #27035

Closed
obskyr opened this issue May 21, 2017 · 11 comments
Closed

Inconsistent undo/redo behavior in Ctrl-F field #27035

obskyr opened this issue May 21, 2017 · 11 comments
Assignees
Labels
editor-find Editor find operations under-discussion Issue is under discussion for relevance, priority, approach

Comments

@obskyr
Copy link

obskyr commented May 21, 2017

  • VSCode Version: 1.12.2
  • OS Version: Windows 10

Steps to Reproduce:

  1. Press Ctrl-F
  2. Type something into the field
  3. Select some text in the file being edited
  4. Press Ctrl-F again
  5. Try to undo/redo using keyboard shortcuts

Characters will be deleted and added almost at random, based on the field's state before the contents were replaced in step 4. This seems to be because the undo/redo history stores characters being entered and deleted, but the replacement of the entire field contents is not stored on the field's history stack. If it were, an undo would simply revert the Ctrl-F field to its earlier state.

Other fields may have the same problem - the basic issue here is that an operation isn't being pushed to the history stack.

@Tyriar Tyriar added the search Search widget and operation issues label May 21, 2017
@sandy081 sandy081 assigned rebornix and alexdima and unassigned sandy081 May 22, 2017
@sandy081 sandy081 added accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues editor-find Editor find operations and removed accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues search Search widget and operation issues labels May 22, 2017
@rebornix
Copy link
Member

@obskyr I do occasionally run into this kind of issue when using the input box in Search Viewlet but I don't have a good repro. can you provide a gif to help troubleshoot?

@rebornix rebornix added the info-needed Issue requires more information from poster label May 22, 2017
@obskyr
Copy link
Author

obskyr commented May 22, 2017

@rebornix Sure! Here you go:

Bug

In this GIF, I:

  1. Type "Hello!" into the main window
  2. Press Ctrl-F
  3. Type "abcdefg"
  4. Select the "Hello!"
  5. Press Ctrl-F
  6. Press Ctrl-Z a few times
  7. Press Ctrl-Shift-Z a few times
  8. Press Ctrl-Z a few times
  9. Press Ctrl-Shift-Z a few times
  10. Press Ctrl-Z until it takes me out of the search field, and from there mess about with Ctrl-Z and Ctrl-Shift-Z a bit more

Also see this related buggy behavior:

Bug 2

In this GIF, I:

  1. Type "Hello!" into the main window
  2. Select it
  3. Press Ctrl-F
  4. Press Ctrl-Z
  5. Type lots of question marks in bewilderment as a second copy of "Hello!" appears where my cursor was in the main window (I've seen it appear in the middle of the word before, so I'm fairly certain it gets put where the cursor is/was.)

@rebornix
Copy link
Member

@obskyr I really appreciate your gif and reproduce steps :)

@rebornix rebornix removed the info-needed Issue requires more information from poster label May 22, 2017
@rebornix
Copy link
Member

It's likely a browser issue as https://w3c.github.io/editing/execCommand.html#introduction is in draft and you can see weird behavior when playing Monaco Find Widget in Chromium but it's kind of good in Firefox.

@rebornix rebornix added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label May 22, 2017
@alexdima alexdima added this to the Backlog milestone May 22, 2017
@alexdima alexdima removed their assignment Nov 24, 2017
@EmpireJones
Copy link

EmpireJones commented Aug 21, 2018

@rebornix, @alexandrudima this bug seems to still exist and is super annoying. Is there a particular upstream project which we need to forward this issue to? monaco-editor?

Also, I'd like to add that it'd be great if the find and replace fields had separate undo stacks, like Atom has. However, such support isn't useful until this issue is fixed.

@rebornix
Copy link
Member

rebornix commented Nov 2, 2020

Now that we are using the shared history enabled input box, maybe we can improve the experience.

@sandy081
Copy link
Member

sandy081 commented Nov 3, 2020

@rebornix Can you please elaborate what improvements you are expecting with history here?

@sandy081
Copy link
Member

Ping @rebornix ☝️

@sandy081 sandy081 added the info-needed Issue requires more information from poster label Nov 13, 2020
@sandy081 sandy081 removed this from the Backlog milestone Nov 13, 2020
@sandy081 sandy081 removed feature-request Request for new features or functionality upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels Nov 13, 2020
@rebornix
Copy link
Member

@sandy081 I found that cmd+z works in a weird way now in the find input, but I'm wondering if it's managed by the history feature

  • Create an untitled text editor
  • CMD+F to open the find widget, type in abcdef
  • Focus the editor, type in hello
  • CMD+F, which will replace the find input keyword to hello
  • CMD+Z multiple times (in my test 4 times), and then the find input keyword becomes hellohellohello

@sandy081
Copy link
Member

I do not think cm+z is an history feature. Not sure who owns this. Sorry.

@sandy081 sandy081 removed their assignment Nov 19, 2020
@sandy081 sandy081 removed the info-needed Issue requires more information from poster label Nov 19, 2020
@rebornix rebornix added the under-discussion Issue is under discussion for relevance, priority, approach label Oct 12, 2021
@amunger
Copy link
Contributor

amunger commented Dec 13, 2022

this seems to be fixed now

@amunger amunger closed this as completed Dec 13, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jan 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-find Editor find operations under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

No branches or pull requests

7 participants