We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3271969 commit 42a7a0dCopy full SHA for 42a7a0d
src/internal/QCodeEditor.cpp
@@ -843,6 +843,17 @@ void QCodeEditor::keyPressEvent(QKeyEvent *e)
843
return;
844
}
845
846
+ if (e->matches(QKeySequence::MoveToStartOfLine))
847
+ {
848
+ auto cursor = textCursor();
849
+ cursor.movePosition(QTextCursor::StartOfLine);
850
+ auto line = cursor.block().text();
851
+ QString startingSpaces = QRegularExpression("^\\s*").match(line).captured();
852
+ cursor.movePosition(QTextCursor::Right, QTextCursor::MoveAnchor, startingSpaces.count());
853
+ setTextCursor(cursor);
854
+ return;
855
+ }
856
+
857
QTextEdit::keyPressEvent(e);
858
859
0 commit comments