0x7c13 / Notepads

A modern, lightweight text editor with a minimalist design.
https://www.NotepadsApp.com
MIT License
8.68k stars 477 forks source link

[Bug] Ctrl + Z (Undo) doesn't work as expected #1151

Open CapoFantasma97 opened 1 year ago

CapoFantasma97 commented 1 year ago

Describe the bug Undoing deleted text doesn't always work or doesn't recover/skips the last step. Part or all of the edited text is lost when attempting to undo. I'm not sure if it follows a logic, because the way it works is at times unpredictable.

To Reproduce Example : Write

1
2
3

Delete 3. Undo. Deletion of 3 is not undone. Keep trying undo: it will undo newline, 2, newline, 1. Ctrl+Y (redo) likewise stops at newline for 3 but doesn't recover 3.

So, you have now 1 /n 2 /n. Delete everything by pressing backspace multiple times. Write test. Then try to undo. test is deleted, but the previous steps aren't recovered. So you are left with an empty file in this example by now.

Deleting by pressing multiple times or holding backspace seems to partly cause these issues. For example:

Write

1
2
3

Select everything, delete. Then, write

a
b
c

Delete by pressing backspace multiple times. Undo multiple times. c is lost, it will recover from its newline, undoing until there's nothing left doesn't return to 1 /n 2/n 3, those are also lost then.

Now try the same but instead of pressing backspace multiple times, select a /n b /n c and delete it in one go. It succeeds in recovering 1 /n 2/n 3.

Occasionally, these issues don't present themselves. Just in case we are oh so lucky that you try once, and that one time doesn't show abnormal behaviors lol, maybe restart the app and retry. It's not device specific because I only noticed this issue due to my father working with text files and asking me how to solve his entire paragraph of text disappearing that he can't recover because he didn't save earlier.

Desktop (please complete the following information):

Additional context I've done the example with single characters for simplicity, but you can replicate them with long lines as well.

CapoFantasma97 commented 1 year ago

It's been a while, but this bug is still present. The Undo mechanic is completely unreliable.

CapoFantasma97 commented 8 months ago

Just reinstalled, the bug is still there. Completely unreliable software, I wouldn't recommend to anyone. A shame considering the graphics are quite nice, even if the default Windows notepad is now close in features.