This design task is to resolve how to handle undo steps in the text editor (and possible text fields in the future).
Possible options:
- Keep current behavior - each key is a single unto step.
- Group by character type / action.
- Group using a timer, so characters typed in quick succession are put into a single undo step.
The timer can be a preference, so users who type slowly or prefer to have the current behavior can either increase the timer or set it to zero.
Note:
- Using a timer may be unpredictable especially when the users typing speed hovers around the limit - undo groupings may seem unpredictable.
- Using whole words may have the disadvantage that large blocks get undone (not fine grained enough).
- Having grouped undo makes it difficult to test undo/redo (developer detail, even so - noting it here).
Proposal
- Undo grouping will only be done for single character insertion/removal.
- Undo wont group edits separated by cursor motion.
- Word level grouping has the same delimiters as pressing Ctrl-Left/Right, this means whitespace/punctuation & alpha-numeric characters will be undone/redone in blocks.
- Have a preference for the text editor to group undo by words or characters. (this allows undo testing code to behave predictably).
Maybe there are other options, @William Reynish (billreynish) we discussed this a while ago.
Creating because D6283: Add undo grouped to Insert and Delete text operator was submitted which.