icsharpcode / AvalonEdit

The WPF-based text editor component used in SharpDevelop
http://avalonedit.net/
MIT License
1.85k stars 469 forks source link

Group similar operations together in the undo stack #422

Open MartinGC94 opened 6 months ago

MartinGC94 commented 6 months ago

Each individual keystroke entered is registered as one action in the undo stack so if I type in a word like "Get" I need to press undo 3 times to undo this action (once for each letter).
It would be nicer if I could undo individual segments, like entire words. The easiest way to recognize individual segments would probably be to keep track of the recent inputs and commit them as a group to the undo stack when the next character is whitespace, newline, etc. or if the cursor is moved.