[NestedListHelper] Improve indentation code
Summary:
The patch includes following improvements:
- handleAfterKeyPressEvent was only used to adjust margins. We don't do it anymore, so get rid of it.
- Add support for Tab key to increase indentation level (either at the beginning of a list item or with multiple lines selected)
- Fix canIndent / canDedent logic when cursor has a selection. canIndent should work with topOfSelection, and canDedent --- with bottomOfSelection.
- Enclose handleOnIndentMore / Less in beginEditBlock / endEditBlock, so they appear as a single event in Undo stack.
- A Return on an empty list element decreases the indentation (so double-Return terminates the list)
Test Plan:
- Tab / Return keys now work as explained
- IndentMore / Less are undoable with single Ctrl+Z
(this leads to cursor jumping around, which is probably beyond the scope of this patch)
- Increase / Decrease Indent actions now become enabled when they should if the selection is present
(the behavior of handleOnIndentMore / Less when selection is present is slightly broken, which is also beyond the scope)
Reviewers: Frameworks, dfaure, mlaurent
Reviewed By: dfaure
Subscribers: kde-frameworks-devel
Tags: Frameworks
Differential Revision: https://phabricator.kde.org/D29208