[KRichTextEdit] Always treat key press as single modification in undo stack
Summary:
If my cursor is on a bullet list, and I press Enter to create a new element,
it registers as 5-7 actions in an undo stack, mostly margins adjustments. So to
rewind it, user has to press Ctrl+Z 5+ times, which is quite frustrating.
Instead this patch suggests to treat _any_ change that is a result of a single
key press as a single event, so user has to press Ctrl+Z just once to undo it
BUG: 256001
Test Plan:
- Open KMail -> New Mail, enable Rich Text mode (or, say, open KJots)
- Create a bullet list with couple of elements
- Put cursor on the last element, press Enter to create a new element
- Try to undo this action with Ctrl+Z
- (without patch) One has to press Ctrl+Z 5-7 times to undo it.
- (with patch) A single Ctrl+Z is enough
Reviewers: Frameworks, mlaurent, dfaure
Reviewed By: dfaure
Subscribers: ahmadsamir, kde-frameworks-devel
Tags: Frameworks
Differential Revision: https://phabricator.kde.org/D28819