Ctrl+Y shortcut deletes a line instead of redoing

Support topics for the mail/news/chat client
Kumba

Ctrl+Y shortcut deletes a line instead of redoing

Post by Kumba » 2015-08-24, 03:45

Checking between Tbird 38.x and FossaMail, it looks like FossaMail's "redo" shortcut of Ctrl+Y appears to be broken. Instead of redoing a recently undone action, it deletes lines of text in the editor. I haven't tried Ctrl+Y in other contexts yet, just while replying to a message. That's when I noticed this.

I have not tested a clean profile yet (and would prefer not to if at all possible) and the only extensions I have loaded are FossaMail's 64-bit lightning and Enigmail 1.8.2 (which is supposedly not compatible, but aside from one little quibble, it works fine so far).

Can't locate any kind of bugs on this in Thunderbird itself via Google...but then again, Google thinks I was tips on fixing shortcuts in VB.NET and Delphi, which apparently had a similar problem at one point (but which was fixed by a quick edit to some config directive somewhere).

Only thing specific to Thunderbird itself is this:
https://bugzilla.mozilla.org/show_bug.cgi?id=365810

But that was ~2007, so it should've been fixed long before FossaMail forked the codebase.

User avatar
Moonchild
Project founder
Project founder
Posts: 39286
Joined: 2011-08-28, 17:27
Location: Sweden

Re: Ctrl+Y shortcut deletes a line instead of redoing

Post by Moonchild » 2015-08-24, 13:37

Sorry, but "Redo" seems to work just fine (in Windows anyway where I've tested this).

Select text, delete, press Ctrl-Z to undo, text restored, Press Ctrl-Y to redo, text is deleted again, so works as intended.
Type some text, press Ctrl-Z to undo, text vanishes, press Ctrl-Y, typing is redone, so works as intended.

Any specific steps to reproduce would be welcome, to verify.
"Praise from a narcissistic person is always a poison dart. They don't share the stage, so discernment matters." - Dr. Ramani
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Kumba

Re: Ctrl+Y shortcut deletes a line instead of redoing

Post by Kumba » 2015-08-25, 08:23

Moonchild wrote:Sorry, but "Redo" seems to work just fine (in Windows anyway where I've tested this).

Select text, delete, press Ctrl-Z to undo, text restored, Press Ctrl-Y to redo, text is deleted again, so works as intended.
Type some text, press Ctrl-Z to undo, text vanishes, press Ctrl-Y, typing is redone, so works as intended.

Any specific steps to reproduce would be welcome, to verify.
Hmm, it appears to be pretty specific. I tried your steps, and as you noted, they work fine. So I played around with it some more, and here's how I can reproduce:

First: Make sure the client replies by quoting the message and prefixing each line with "> " -- not sure if this is a default or not. I've been using it for years. Don't know if it's part of the problem or not.
  1. Pick a message (any message) and hit "Reply", preferably one with a few paragraphs of text, such as a Topic Reply notification from these forums.
  2. Put the cursor at a blank line between two paragraphs and tap 'Enter' a few times, kinda like you're spacing down to respond inline to something.
  3. Mash the keys at random to generate some text.
  4. Repeat Step #2 and Step #3 at another point in the reply, like you're addressing two different points inline in a response.
  5. Select some text on the first line of mashed characters.
  6. Delete that selection.
  7. Place the cursor at the front of the second line of mashed characters.
  8. Hit Ctrl+Z three times. This has the effect of undo'ing the deletion from Step #6, and it then undoes the second line of mashed characters and spacing from Step #4.
  9. NOW, hit Ctrl+Y. One expects the spacing/mashed characters undone in Step #8 to be redone. Instead, the line of text directly below the first line of mashed characters (from Step #1) will be deleted.
  10. Continue to press Ctrl+Y and it'll continue to delete all lines of text BELOW the first line of mashed characters, up until your signature block (if you use one).
It seems like the command to delete the text selection (Step #6) gets stuck...maybe...and is constantly re-executed with each press of Ctrl+Y and keeps deleting lines. Not real sure. I am unable to reproduce this behavior on Thunderbird 38.x. Not going to bother trying older Thunderbird releases for fear of trampling over my 10+ years of e-mail saved in my profile (oh, how I wish there was an addon to create Outlook-style PST files...)

I also downgraded to Enigmail 1.7.2 JUST in case that was the cause...but it's not.

Let me know if that works for you or not.

User avatar
Moonchild
Project founder
Project founder
Posts: 39286
Joined: 2011-08-28, 17:27
Location: Sweden

Re: Ctrl+Y shortcut deletes a line instead of redoing

Post by Moonchild » 2015-08-25, 11:27

I think something else may actually interfere here.

Ctrl+Y can only redo the last undone action, and then it is disabled as a function. The hotkey can then, if intercepted as a global hotkey by other software installed, result in unexpected behavior.
FossaMail doesn't retain a full backward/forward history of undo/redo -- that's just not in the program. You can undo multiple operations with ctrl-z, but can't re-do those multiple actions; only the very last one you undid.
"Praise from a narcissistic person is always a poison dart. They don't share the stage, so discernment matters." - Dr. Ramani
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Kumba

Re: Ctrl+Y shortcut deletes a line instead of redoing

Post by Kumba » 2015-08-25, 18:28

Moonchild wrote:I think something else may actually interfere here.

Ctrl+Y can only redo the last undone action, and then it is disabled as a function. The hotkey can then, if intercepted as a global hotkey by other software installed, result in unexpected behavior.
FossaMail doesn't retain a full backward/forward history of undo/redo -- that's just not in the program. You can undo multiple operations with ctrl-z, but can't re-do those multiple actions; only the very last one you undid.
This must be a new feature of Thunderbird 38 then. I just tested those exact steps again in it, and it has a full history of undo/redo, and does not delete lines like FossaMail is doing. Following my own steps, hitting Ctrl+Z thrice will back me up to Step #4, and hitting Ctrl+Y thrice will take me back to just past Step #7.

Can you check to see if this is something added between the 31.x and 38.x series? I think you'll have a better grasp of the Thunderbird codebase to track down changes to whatever the component is that Thunderbird uses for a text editing widget to see if multi-buffered undo/redo is a new thing or not. I did a quick search on Google using some basic keywords and limited results to bugzilla.mozilla.org, but nothing really stood out in the first two pages of results. Or, if you can at least point me to the name/source file of the widget used by Thunderbird/FossaMail when editing messages, I can dig around in their git repo to see if a particular changeset stands out.

Maybe this weekend, I can install Thunderbird 31.x and 38.x into one of my VMs, along w/ FossaMail, keep it a vanilla install, and try my steps out to see if maybe there really is an add-on interfering, or if it's a new feature in 38.x or a really obscure bug in FossaMail.

If multi-redo is a new feature, then I'd like to request that you give consideration to incorporating it in a future release of FossaMail, depending on how big of a change it is. Otherwise, if I really have stumbled onto a quirky bug of some kind, fixing it would be nice :) A lot of software out there has multiple undo/redo buffers these days (my ancient copy of Paint Shop Pro 7 being the oldest that I know of), so I think I stumbled onto this just out of sheer habit of expecting it to be standard in most software.

User avatar
Moonchild
Project founder
Project founder
Posts: 39286
Joined: 2011-08-28, 17:27
Location: Sweden

Re: Ctrl+Y shortcut deletes a line instead of redoing

Post by Moonchild » 2015-08-25, 19:15

Depending on how complex it is to implement, I'll certainly give it some attention if its indeed an added feature that can possibly be ported across.
"Praise from a narcissistic person is always a poison dart. They don't share the stage, so discernment matters." - Dr. Ramani
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite