[KRichTextEdit] Make sure headings don't mess with undo stack
Summary:
This patch ensures that everything related to headings is undoable
with a single Ctrl+Z. It also adds tests for the following use cases
(ensuring those are undoable with a single undo command):
- Make line a heading
- Creating a newline after a heading
- Merging a heading and non-heading line with Delete key
- The same, with Backspace key
Test Plan: make && ctest
Reviewers: Frameworks, dfaure
Reviewed By: dfaure
Subscribers: kde-frameworks-devel
Tags: Frameworks
Differential Revision: https://phabricator.kde.org/D28968