fix(macos): check selection in cmd+backspace (#6469)

This commit is contained in:
nerix
2025-09-20 11:39:31 +02:00
committed by GitHub
parent 9fb9881fde
commit 8e9df07ab3
2 changed files with 6 additions and 1 deletions
+5 -1
View File
@@ -136,7 +136,11 @@ void ResizingTextEdit::keyPressEvent(QKeyEvent *event)
(event->key() == Qt::Key_Backspace))
{
QTextCursor cursor = this->textCursor();
cursor.movePosition(QTextCursor::StartOfLine, QTextCursor::KeepAnchor);
if (!cursor.hasSelection())
{
cursor.movePosition(QTextCursor::StartOfLine,
QTextCursor::KeepAnchor);
}
cursor.removeSelectedText();
this->setTextCursor(cursor);
return;