Attempted to fix reset state while replying with Ctrl+Up/Down hotkey.

Regression was introduced: a05d85673a.
This commit is contained in:
23rd
2026-01-31 09:10:43 +03:00
parent 9a04220129
commit e672041a79
2 changed files with 11 additions and 5 deletions
@@ -7755,7 +7755,7 @@ bool HistoryWidget::replyToPreviousMessage() {
controller()->showMessage(previous);
if (isFieldVisible) {
if (previous->isLocal()) {
cancelReply();
cancelReply(false, true);
} else {
replyToMessage(previous);
}
@@ -7798,13 +7798,12 @@ bool HistoryWidget::replyToNextMessage() {
controller()->showMessage(next);
if (isFieldVisible) {
if (next->isLocal()) {
cancelReply();
cancelReply(false, true);
} else {
replyToMessage(next);
}
}
} else {
_highlighter.clear();
cancelReply(false);
}
return true;
@@ -8971,7 +8970,9 @@ bool HistoryWidget::cancelReplyOrSuggest(bool lastKeyboardUsed) {
return ok1 || ok2;
}
bool HistoryWidget::cancelReply(bool lastKeyboardUsed) {
bool HistoryWidget::cancelReply(
bool lastKeyboardUsed,
bool keepHighlighterState) {
bool wasReply = false;
if (_replyTo) {
wasReply = true;
@@ -8986,6 +8987,9 @@ bool HistoryWidget::cancelReply(bool lastKeyboardUsed) {
_fieldBarCancel->hide();
updateMouseTracking();
}
if (!keepHighlighterState) {
_highlighter.clear();
}
updateBotKeyboard();
refreshTopBarActiveChat();
updateCanSendMessage();
@@ -222,7 +222,9 @@ public:
bool lastForceReplyReplied(const FullMsgId &replyTo) const;
bool lastForceReplyReplied() const;
bool cancelReplyOrSuggest(bool lastKeyboardUsed = false);
bool cancelReply(bool lastKeyboardUsed = false);
bool cancelReply(
bool lastKeyboardUsed = false,
bool keepHighlighterState = false);
bool cancelSuggestPost();
void cancelEdit();
void updateForwarding();