executeHandleCut function

Future<void> executeHandleCut(
  1. FluentDocument document
)

Implementation

Future<void> executeHandleCut(FluentDocument document) async {
  final cursor = document.cursor;
  if (cursor.isCollapsed) return;

  // First copy the selection
  await executeHandleCopy(document);

  // Then delete the selection
  executeHandleReplaceSelection('', document);

  // Update the document
  document.updateContent();
}