From 1ef877d9a5dd8ca6c1c0d737184331f5fd15e9df Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Wed, 6 Nov 2019 23:11:56 +0300 Subject: [PATCH] Fixed moving cursor to begin/end when using reply shortcuts for macOS. --- Telegram/SourceFiles/history/history_widget.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 069b81a11..3ff0e1619 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -3610,8 +3610,20 @@ bool HistoryWidget::eventFilter(QObject *obj, QEvent *e) { const auto k = static_cast<QKeyEvent*>(e); if ((k->modifiers() & kCommonModifiers) == Qt::ControlModifier) { if (k->key() == Qt::Key_Up) { +#ifdef Q_OS_MAC + // Cmd + Up is used instead of Home. + if (!_field->textCursor().atStart()) { + return false; + } +#endif return replyToPreviousMessage(); } else if (k->key() == Qt::Key_Down) { +#ifdef Q_OS_MAC + // Cmd + Down is used instead of End. + if (!_field->textCursor().atEnd()) { + return false; + } +#endif return replyToNextMessage(); } }