getCurrentLineText(); $cursorInLine = $buffer->getCursorPositionInLine(); $lineStart = $buffer->getCursor() - $cursorInLine; // For whitespace-only lines, treat the whole line as having no indent $firstNonWhitespace = \strspn($line, " \t"); if ($firstNonWhitespace === \strlen($line)) { $firstNonWhitespace = 0; } $targetColumn = $cursorInLine === $firstNonWhitespace ? 0 : $firstNonWhitespace; $buffer->setCursor($lineStart + $targetColumn); return true; } /** * {@inheritdoc} */ public function getName(): string { return 'move-to-start'; } }