executeHandleOutdent function
Handles the TAB and SHIFT+TAB keys.
Lists:
- TAB: indent (moves item as sub-item of the previous one)
- SHIFT+TAB: outdent (promotes to the upper level)
Tables:
- TAB: moves to the next cell (creates new row if needed)
- SHIFT+TAB: moves to the previous cell
Paragraphs:
- TAB: increases indentation (max 10)
- SHIFT+TAB: decreases indentation (min 0) Executes outdent of the current ListItem (also used by Enter on empty item).
Implementation
bool executeHandleOutdent(FluentDocument document) {
final root = document.content;
final cursor = document.cursor;
final container = findLogicalContainer(root, cursor.anchorId);
if (container == null) return false;
final ancestorItem = _findAncestor<ListItem>(root, container as FNode);
if (ancestorItem == null) return false;
return executeHandleOutdentItem(document, ancestorItem);
}