aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2023-05-24 16:21:17 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2023-05-25 13:43:26 +0000
commit2cd71a18fc842f2a9749adbc9d1973987dc1ffc5 (patch)
treef9df7d03992d1fe4be8bfab2c1c233bbe6a7499f
parent50f277ef8ac4edb944f7a26d25f5fb7dcefd050d (diff)
CppEditor: Fix raw string highlighting with embedded empty lines
We missed an early return in highlightBlock(). Task-number: QTCREATORBUG-29200 Change-Id: I3f32c2948ff778a9b558850235058537fcd48fd1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
-rw-r--r--src/plugins/cppeditor/cpphighlighter.cpp1
-rw-r--r--src/plugins/cppeditor/testcases/highlightingtestcase.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/cppeditor/cpphighlighter.cpp b/src/plugins/cppeditor/cpphighlighter.cpp
index 1f83b317ad..90bea63709 100644
--- a/src/plugins/cppeditor/cpphighlighter.cpp
+++ b/src/plugins/cppeditor/cpphighlighter.cpp
@@ -76,6 +76,7 @@ void CppHighlighter::highlightBlock(const QString &text)
setFormat(0, text.length(), formatForCategory(C_VISUAL_WHITESPACE));
}
TextDocumentLayout::setFoldingIndent(currentBlock(), foldingIndent);
+ TextDocumentLayout::setExpectedRawStringSuffix(currentBlock(), inheritedRawStringSuffix);
return;
}
diff --git a/src/plugins/cppeditor/testcases/highlightingtestcase.cpp b/src/plugins/cppeditor/testcases/highlightingtestcase.cpp
index 20fa252646..36e3a4b17b 100644
--- a/src/plugins/cppeditor/testcases/highlightingtestcase.cpp
+++ b/src/plugins/cppeditor/testcases/highlightingtestcase.cpp
@@ -1,7 +1,7 @@
auto func()
{
return R"(foo
- foobar
+
R"notaprefix!(
barfoobar)" R"(second)" /* comment */ R"(third)";
}