tweak/markitup_preserve_undo_stack

Jan 28, 2022 3:51 pm

Have you looked at this on staging? Public

No
Yes - I'm happy with it
Briefly - I'm happy with it
Yes - I'm NOT happy with it
Quote
Jan 28, 2022 3:57 pm
I just tried it out a bit and it doesn't quite act like it's supposed to, I think. (Why did you have to capslock the NOT in the poll, by the way? Makes it sound so aggressive).

Ctrl+Z'ing after adding the bold command doesn't just remove the bold command, it undoes... a bunch of things? Seems kind of unpredictable. Sometimes it removed everything I typed, sometimes it only removed the bolding. Sometimes it removed part of what I wrote before.
Might be based on the time that passed or something?
Quote
Jan 28, 2022 4:00 pm
bowlofspinach says:
I just tried it out a bit and it doesn't quite act like it's supposed to, I think. (Why did you have to capslock the NOT in the poll, by the way? Makes it sound so aggressive).

Ctrl+Z'ing after adding the bold command doesn't just remove the bold command, it undoes... a bunch of things? Seems kind of unpredictable. Sometimes it removed everything I typed, sometimes it only removed the bolding. Sometimes it removed part of what I wrote before.
Might be based on the time that passed or something?
Try Ctrl+Z in this thread (without using markitup functions). I think you're just seeing normal chrome behaviour.
Quote
Jan 28, 2022 4:06 pm
I can not get it to misbehave as described above. Undoing bolding and such work as expected. Nice.

type, bold, type type, bold; then ctrl-z undoes bold, then undoes both types, then unbolds, then untypes. Seems tight to me, the middle two typings are really one action.
Quote
Jan 28, 2022 4:08 pm
I've tested it on:
Windows 11: Chrome, Firefox and Edge
Mac OS: Chrome and Safari

I think it works.
Quote
Jan 28, 2022 4:10 pm
But I see what BoS means about the way Chrome handles undo. I'd never really noticed it before, but it can seem a bit WTF when you're paying attention (and perfect when you're not).
Quote
Jan 28, 2022 4:23 pm
Just to be clear - it's not like I've changed the way undo works.

This tweak is basically the code equivalent of: "Yo Markitup! If you need to add tags, don't smash them into the textbox - add them like the user pasted the text instead. K. Thx."
Quote
Jan 28, 2022 4:32 pm
Maybe it is normal behavior. I'll have to test it a bit more extensively, I think to see how it does when I'm doing more than just inputting single words and tags
Quote
Jan 28, 2022 4:45 pm
Fortunately, if the ctrl-z does something strange, shift-ctrl-z undoes the undo, putting things back as they were. With this remedy, so far I have not lost anything.
Quote
Jan 28, 2022 7:36 pm
win11,chrome 👍
Quote
Jan 29, 2022 11:01 am
Okay, after trying it a bit more extensively now, I don't find the undo thing useful the way it works now. I don't have anything against adding it like this but it won't help me with what I wanted it for.
Quote:
add them like the user pasted the text instead
Interestingly, if I paste something with Ctrl+V and then undo that, it always works perfectly

You do not have permission to post in this thread.