Skip to content

Commit fb4fcf5

Browse files
committed
Attempted to fix reset state while replying with Ctrl+Up/Down hotkey.
Regression was introduced: a05d856.
1 parent e5cc336 commit fb4fcf5

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

Telegram/SourceFiles/history/history_widget.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7755,7 +7755,7 @@ bool HistoryWidget::replyToPreviousMessage() {
77557755
controller()->showMessage(previous);
77567756
if (isFieldVisible) {
77577757
if (previous->isLocal()) {
7758-
cancelReply();
7758+
cancelReply(false, true);
77597759
} else {
77607760
replyToMessage(previous);
77617761
}
@@ -7798,13 +7798,12 @@ bool HistoryWidget::replyToNextMessage() {
77987798
controller()->showMessage(next);
77997799
if (isFieldVisible) {
78007800
if (next->isLocal()) {
7801-
cancelReply();
7801+
cancelReply(false, true);
78027802
} else {
78037803
replyToMessage(next);
78047804
}
78057805
}
78067806
} else {
7807-
_highlighter.clear();
78087807
cancelReply(false);
78097808
}
78107809
return true;
@@ -8971,7 +8970,9 @@ bool HistoryWidget::cancelReplyOrSuggest(bool lastKeyboardUsed) {
89718970
return ok1 || ok2;
89728971
}
89738972

8974-
bool HistoryWidget::cancelReply(bool lastKeyboardUsed) {
8973+
bool HistoryWidget::cancelReply(
8974+
bool lastKeyboardUsed,
8975+
bool keepHighlighterState) {
89758976
bool wasReply = false;
89768977
if (_replyTo) {
89778978
wasReply = true;
@@ -8986,6 +8987,9 @@ bool HistoryWidget::cancelReply(bool lastKeyboardUsed) {
89868987
_fieldBarCancel->hide();
89878988
updateMouseTracking();
89888989
}
8990+
if (!keepHighlighterState) {
8991+
_highlighter.clear();
8992+
}
89898993
updateBotKeyboard();
89908994
refreshTopBarActiveChat();
89918995
updateCanSendMessage();

Telegram/SourceFiles/history/history_widget.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ class HistoryWidget final
222222
bool lastForceReplyReplied(const FullMsgId &replyTo) const;
223223
bool lastForceReplyReplied() const;
224224
bool cancelReplyOrSuggest(bool lastKeyboardUsed = false);
225-
bool cancelReply(bool lastKeyboardUsed = false);
225+
bool cancelReply(
226+
bool lastKeyboardUsed = false,
227+
bool keepHighlighterState = false);
226228
bool cancelSuggestPost();
227229
void cancelEdit();
228230
void updateForwarding();

0 commit comments

Comments
 (0)