From 8e9df07ab3ae5ae9a071637986f8ee87a3dc6560 Mon Sep 17 00:00:00 2001 From: nerix Date: Sat, 20 Sep 2025 11:39:31 +0200 Subject: [PATCH] fix(macos): check selection in cmd+backspace (#6469) --- CHANGELOG.md | 1 + src/widgets/helper/ResizingTextEdit.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6ea6bb0..ea3cb882 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - 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 an issue where the moderation icon was missing from the Moderation tab. (#6457) +- Bugfix: Fixed CMD+Backspace not working in the input on macOS if there was a selection. (#6469) - Dev: Added documentation for WebSockets to `wip-plugins.md`. (#6432) - Dev: Enable the hardened runtime on macOS. (#6467) diff --git a/src/widgets/helper/ResizingTextEdit.cpp b/src/widgets/helper/ResizingTextEdit.cpp index 77a677d7..3e5361c1 100644 --- a/src/widgets/helper/ResizingTextEdit.cpp +++ b/src/widgets/helper/ResizingTextEdit.cpp @@ -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;