18

When you hit Ctrl+Z, the number of inputs you've entered that are undone seems pretty random.

In the latest example that brought me here, I was converting regular lines into a blockquote in this question,1 and had done about 20 of them by this method:

  1. Type two spaces at the end of a line and copy them
  2. Hit and End
  3. Hit Ctrl+V
  4. Repeat steps 2 & 3

I accidentally forgot to hit End in a line, pasted in the wrong place, hit Ctrl+Z, and all of the double spaces were removed up to the start of the blockquote. Argh!

But there are many such instances. As a case in point, I just wrote the first sentence of this paragraph, hit Ctrl+Z, and the whole line was removed. But if I select a random word in this paragraph and type another in its place, and then hit Ctrl+Z, only that one word is reverted to what it was. The problem is that when behaviour is unpredictable, users avoid the function. That's what I do whenever I consciously think to myself, "Oh, right, I'm using the SE editor. There is no reliable undo."

I know this isn't unique to Stack Exchange — Word also tries and sometimes fails to guess a more "natural" delimiter of your sequence of inputs — but I find it particularly bad here.

So why is it like it is, and should it be changed to a more standard algorithm?


1 Unrelated, but entering this link reminded me that on SE, unlike every other site and word processor, adding a link is Ctrl+L instead of Ctrl+K, because the latter is used for code insertion...

14
  • 8
    For me the undo just reset the whole textbox, same as CTRL+A and BACKSPACE. After several attempts, I stopped using it and marked the SE editor as "never undo" and I'm not even trying. Commented Aug 22, 2023 at 12:42
  • 4
    Related or dupe, and several other bug reports about the unstable undo function of the editor. (None got any attention from SE developers, except one about keyboard shortcut and one about the now-dead app) Commented Aug 22, 2023 at 12:45
  • 7
    They overwrite your browser's (or OS's?) standard behavior with whatever this monstrosity is that doesn't work with copy/paste. Once upon a time I made a userscript that prevented the editor from capturing ctrl/command+Z and it was fantastic.
    – Laurel
    Commented Aug 22, 2023 at 12:53
  • There is a WYSIWYG editor? Commented Aug 22, 2023 at 16:20
  • @user3840170 Detached, but good point. Edited out that wording for clarity. Commented Aug 22, 2023 at 16:27
  • 1
    @user3840170 Yes, there is a WYSIWYG editor, which SE has been working on for 3? years, but still has significant problems and missing features. You can enable it as a "beta" option ("Enable new editor") in your settings->preferences for answers on MSE and MSO. Some people like it. Others of us seriously dislike it, for a variety of reasons. Personally, I find it unusable, because almost any time I paste something, it wipes the entire post's content. It's used, without the option to use the normal SE editor, for the new question wizard on SO and everywhere within Stack Overflow for Teams.
    – Makyen
    Commented Aug 22, 2023 at 16:35
  • What are you actually looking for here? Are you looking for the historical reasons why such a feature was, effectively, necessary (i.e. that years ago browsers' implementation of undo/redo was ... inconsistent within <textarea> elements)? Are you looking for a technical discussion as to how it operates to explain "Why is the SE editor's undo function so unpredictable?" Are you looking for one or more of at least a few different workarounds which disable SE's undo/redo feature? For opinions as to if people like it or not and if they would prefer the native operation?
    – Makyen
    Commented Aug 22, 2023 at 16:55
  • 3
    @Makyen Primarily the technical discussion, in the hopes that this would (a) demystify it and make it less unpredictable and (b) lead somehow to a path to addressing the issue. Commented Aug 22, 2023 at 17:16
  • 8
    Agreed, it's not usable. Commented Aug 22, 2023 at 18:31
  • 1
    Did you know that using Cmd[or ctrl]/Shift/Z restores your Undo in smaller bits than the Undo itself, so you can jump backwards then step forwards again. Not perfect, but it does get you out of jail on occasion.
    – Tetsujin
    Commented Aug 23, 2023 at 6:48
  • What browser (incl. version)? It may be the browser itself. Firefox behaves in this way; the action of the Ctrl + Z in Firefox in unpredictable / unexpected, and thus can not be trusted. Commented Aug 23, 2023 at 11:18
  • 1
    @This_is_NOT_a_forum SE have included custom code for Ctrl+Z in the editor. It's not browser behaviour. It's most likely there to unify browser behaviour. Yet, that's obsolete.
    – VLAZ
    Commented Aug 23, 2023 at 11:19
  • Related: Ctrl+Z undoes twice in editor Commented Aug 23, 2023 at 11:21
  • @This_is_NOT_a_forum I use Firefox, and indeed I saw the WhatsApp question that was on HNQ for days, but that's not a universal problem. The vast majority of editors (presumably using browser defaults) behave just fine in Firefox, while multiple browers work terribly on SE. Commented Aug 23, 2023 at 12:42

0

You must log in to answer this question.

Browse other questions tagged .