cursorLineStart static method

TransactionSpec cursorLineStart(
  1. EditorState state
)

Move the cursor to the start of the current line.

Implementation

static TransactionSpec cursorLineStart(EditorState state) {
  final head = state.selection.main.head;
  final line = state.doc.lineAtOffset(head);
  return TransactionSpec(selection: EditorSelection.cursor(line.from));
}