aboutsummaryrefslogtreecommitdiffstats
path: root/src/composewindow.cpp
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-24 10:40:23 +0200
committerDanilo M. <danix@danix.xyz>2026-08-24 10:40:23 +0200
commitdf5f64f16359c9e34d258758f174187ffc618101 (patch)
tree85b1a3fd49ce84f47fb80218a47ff9a383ed67b8 /src/composewindow.cpp
parentfabcf080652c6e5d57bf234be5e100769a9b965b (diff)
downloadqtmaildir-df5f64f16359c9e34d258758f174187ffc618101.tar.gz
qtmaildir-df5f64f16359c9e34d258758f174187ffc618101.zip
fix(compose): put the reply cursor on blank space, not on the quote
quote_position names where the QUOTE goes, so the reply belongs on the other side of it and the cursor has to follow the reply rather than the buffer. seedBody() moved the cursor to Start under both positions, which is correct only for Below: under Above, the shipped default, it landed on the "On ... wrote:" attribution line, so every reply had to have room made before it could be typed. End under Above, Start under Below. The existing theQuotePositionDecidesWhereTheQuoteLands passed throughout the defect and still does, because the quote was in the right place all along; only the cursor was not. The new test asserts the cursor's block is blank, and that typing lands on the correct side of the quote, so a fix that freed the cursor by inverting the position would not satisfy it. Also re-measures item 136 in the backlog, which is not the intermittent race it was filed as: undoMovesTheMessageBack fails 6 runs in 6 when named alone and passes in the full suite, on a clean tree, so it depends on the tests before it.
Diffstat (limited to 'src/composewindow.cpp')
-rw-r--r--src/composewindow.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/composewindow.cpp b/src/composewindow.cpp
index 0445c5d..59eaccc 100644
--- a/src/composewindow.cpp
+++ b/src/composewindow.cpp
@@ -442,19 +442,22 @@ void ComposeWindow::seedBody()
// tracking "my text" and "the quote" as separate pieces to make a toggle
// reversible is machinery for a case answered by closing the composer and
// reopening it.
+ // quote_position names where the QUOTE goes, so the reply goes on the
+ // other side of it, and the cursor follows the reply rather than the
+ // buffer. Start in both cases was wrong for Above: it put the cursor on
+ // the attribution line, so the user had to make room before typing.
if (m_config.compose().quotePosition
== ComposeSettings::QuotePosition::Above) {
- // The quote first, then a blank line for the reply to be typed into.
+ // The quote first, then blank lines for the reply, and the cursor in
+ // them. Two lines rather than one so the reply is separated from the
+ // attribution by a blank line once typing starts.
m_body->setPlainText(m_context.quotedBody + QStringLiteral("\n\n"));
+ m_body->moveCursor(QTextCursor::End);
} else {
m_body->setPlainText(QStringLiteral("\n\n") + m_context.quotedBody);
+ m_body->moveCursor(QTextCursor::Start);
}
- // The cursor at the very top in both cases: with the quote below, the
- // blank lines the reply goes into are at the top; with it above, the user
- // scrolls past what they are answering, which is what quoting above means.
- m_body->moveCursor(QTextCursor::Start);
-
// The seeded quote is not an edit the user made, so it must not survive as
// an undo step: one Ctrl+Z on a fresh composer would otherwise wipe the
// quote and read as the buffer losing its content.