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
+1
View File
@@ -8,6 +8,7 @@
- Bugfix: Fixed flickering tooltips on Wayland when the mouse cursor is over them. (#6451) - Bugfix: Fixed flickering tooltips on Wayland when the mouse cursor is over them. (#6451)
- Bugfix: Fixed `c2.Channel` comparing `false` to the same channel. (#6456) - Bugfix: Fixed `c2.Channel` comparing `false` to the same channel. (#6456)
- Bugfix: Fixed an issue where the moderation icon was missing from the Moderation tab. (#6457) - Bugfix: Fixed an issue where the moderation icon was missing from the Moderation tab. (#6457)
- Bugfix: Fixed <kbd>CMD</kbd>+<kbd>Backspace</kbd> not working in the input on macOS if there was a selection. (#6469)
- Dev: Added documentation for WebSockets to `wip-plugins.md`. (#6432) - Dev: Added documentation for WebSockets to `wip-plugins.md`. (#6432)
- Dev: Enable the hardened runtime on macOS. (#6467) - Dev: Enable the hardened runtime on macOS. (#6467)
+5 -1
View File
@@ -136,7 +136,11 @@ void ResizingTextEdit::keyPressEvent(QKeyEvent *event)
(event->key() == Qt::Key_Backspace)) (event->key() == Qt::Key_Backspace))
{ {
QTextCursor cursor = this->textCursor(); QTextCursor cursor = this->textCursor();
cursor.movePosition(QTextCursor::StartOfLine, QTextCursor::KeepAnchor); if (!cursor.hasSelection())
{
cursor.movePosition(QTextCursor::StartOfLine,
QTextCursor::KeepAnchor);
}
cursor.removeSelectedText(); cursor.removeSelectedText();
this->setTextCursor(cursor); this->setTextCursor(cursor);
return; return;