isMultilineMode()) { return false; } $line = $buffer->getCurrentLineText(); $cursorInLine = $buffer->getCursorPositionInLine(); $beforeCursor = \substr($line, 0, $cursorInLine); if (\trim($beforeCursor) !== '') { return false; } $spaces = $buffer->spacesToNextTabStop($cursorInLine); $buffer->insert(\str_repeat(' ', $spaces)); return true; } /** * {@inheritdoc} */ public function getName(): string { return 'insert-indent-on-tab'; } }