Friday, January 22, 2021

Can we make Cmd+Z undo Cmd+V (only)?

Hey developers! If you're fortunate enough to be doing greenfield development on a new text editing app or component, I have a quick feature request for you!

In all existing text editors and text fields that I'm aware of, if you do the following:

  1. Key in some text.
  2. Append another piece of text via a press of Cmd+V (Ctrl+V on Windows) to paste from the clipboard.
  3. Press Cmd+Z (Ctrl+Z on Windows) to undo.

What happens is that both the pasted text, and some or all of the keyed-in text, get removed.

What I'd like to have happen is for only the pasted text to be removed. The keyed-in text can be removed upon additional Cmd+Z press(es).

I bump into this problem quite frequently when I Cmd+V to append something to some text I'm in the middle of composing. I see that the wrong thing was on the clipboard and got added to the text, reflexively hit Cmd+Z to try and undo that mistake -- and now I have two problems, because some of the text that I had keyed in got removed along with the incorrect pasted-in value.

It would be super fun to have this no longer be an issue in the text editors of the future. Thanks in advance! 👍

No comments:

Post a Comment

Hi spammers! No need to waste your time here; comments are heavily moderated, so if you like, you can save us both a little time and just move on to the next site. :-)

For everyone else: Thanks for visiting! Your comments are more than welcome!