Notepad3: Regression about undo/redo

Created on 15 Jul 2019  ·  21Comments  ·  Source: rizonesoft/Notepad3

Version

d14e227cc6e434c75b11eed7cc3a9afe0d943141

Steps to Reproduce

  1. Create an empty file.
  2. Type abcdefghijlkmn.
  3. Press Ctrl-Z repeatedly to undo the input.
  4. Press Ctrl-Y repeatedly to redo the input.

Behavior Got

Undo/redo is now character-wise. Additionally, in order to undo/redo each character other than the last one, the combination key has to be pressed _twice_.

Behavior Expected

The sequential keystrokes should be considered as an integral operation. A single Ctrl-Z should suffice to undo it. So is Ctrl-Y.

🐞 bug

All 21 comments

Hello @RaiKoHoff ,
Tested Final Notepad3 v5.19.630.2381: Ctrl+Z and Ctrl+Y consider abcdefghijlkmn as a unit.

Feel free to test beta version _5.19.715.2393_BETA (beta channel access see: #1129).

LGTM. Thanks for the fix.

@RaiKoHoff

seems like now it has the opposite problem, where everything is considered as a single undo transaction?

EDIT: this only seems to be the case when authoring new content:

  1. type some text
  2. wait 1 sec
  3. press enter (new line) type some more text
  4. wait 1 sec
  5. press enter (new line) type some more text
  6. press ctrl+z undoes everything above.

i would expect there to be some timeout between closing the undo transaction. 1 sec seems reasonable to me.

I fail to see what's wrong here:

  1. Create an empty file.
  2. Type aaaaaaaaaaa followed by Enter
  3. Type bbbbbbbbbb followed by Enter
  4. Type cccccccccccc followed by Enter
  5. Select the first line by left-clicking on the line number column, copy it and paste it at the end.
  6. Select the second line by left-clicking on the line number column, copy it and paste it at the end.
  7. The text area now contains 5 lines. Pressing Ctrl-Z undoes the second paste; pressing it again undoes the first paste; pressing it once more undoes the first three lines because they are a whole.

pressing it once more undoes the first three lines because they are a whole.

that's kinda the crux of this for me. if there is sufficient time between user activity, then each is a separate transaction in my view. this seems to only affect exclusively appending new data by keyboard entry.

SublimeText and LibreOffice Writer works more like i described. VScode seems to rely on some combination of a timeout and whitespace (or complete non-whitespace tokens). Notepad++ works like Notepad3 (probably since both scintilla).

so while not a bug, per se, it would be quite useful if there was a minimal amount of smarts around doing partial undos of long-lived append-only transactions.

If the caret is moved elsewhere after inserting some text, but moved back before inserting more (so the insert position doesn't change despite the move), the two insert operations are still considered a single unit. Probably this is undesired, but I am fine with either.

I vote against an undo split based on some timeout settings, and do not change Scintilla's undo/redo default in this case.

I second your vote... 😃

the nays have it!

@leeoniya : to track this discussion, just create a new issue (change request) for this.

i don't feel strongly enough about it, so if you guys don't see enough reason to add it, then that's fine.

thanks, will test later today!

from prelimnary testing, 5.19.828.2604 BETA behaves as i'd expect. :+1:

We still have this bug (Point 1 of https://github.com/rizonesoft/Notepad3/issues/1548#issuecomment-525555914), so I suggest to keep this issue open until we have a solution for it.

New development beta version (_5.19.828.2605_BETA) available.

Thank you for testing and issue reporting :smile: - Feel free to test dev beta ver _5.19.904.2617_BETA.

Hello @lhmouse ,
As far as I'm concerned, I think you (as requester) can close this issue...

oh ok.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hpwamr picture hpwamr  ·  4Comments

craigo- picture craigo-  ·  4Comments

valhristov picture valhristov  ·  3Comments

vvyoko picture vvyoko  ·  3Comments

zb-z picture zb-z  ·  3Comments