aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/cplusplus/MatchingText.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2025-10-08 10:48:56 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2025-10-08 13:47:57 +0000
commit6082f85ee51a1957c5696633cf56b191de490ad5 (patch)
tree319ef294fd018c4d3c743d47dcac57544faf8a41 /src/libs/cplusplus/MatchingText.cpp
parentef0cb6e072dcc4948b865fd12dafbde3a66a4551 (diff)
CppEditor: Prevent spuriously applying raw string prefix magic
The application of the insertion action has to act under the same condition as the check. Amends 1bce50a4c4d0e5b76480887b8498b8936f0acdff. Fixes: QTCREATORBUG-33596 Change-Id: I1512bec0059a517f148e6ef1519f4dafca723edc Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/libs/cplusplus/MatchingText.cpp')
-rw-r--r--src/libs/cplusplus/MatchingText.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libs/cplusplus/MatchingText.cpp b/src/libs/cplusplus/MatchingText.cpp
index 0a8d3e4b4f2..e364a46acd1 100644
--- a/src/libs/cplusplus/MatchingText.cpp
+++ b/src/libs/cplusplus/MatchingText.cpp
@@ -419,6 +419,7 @@ bool MatchingText::contextAllowsAutoParentheses(const QTextCursor &cursor,
if (c == '"' && cursor.document()->characterAt(pos - 1) == 'R')
return true;
}
+ return false;
}
}
@@ -536,7 +537,7 @@ QString MatchingText::insertMatchingBrace(const QTextCursor &cursor, const QStri
}
}
- if (textToProcess == "(") {
+ if (textToProcess == "(" && cursor.document()->characterAt(cursor.position()) == '"') {
const Kind tokKind = stringKindAtCursor(cursor);
if (tokKind >= T_FIRST_RAW_STRING_LITERAL && tokKind <= T_LAST_RAW_STRING_LITERAL) {
QString result;