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>
This commit is contained in:
Christian Kandeler
2023-05-24 16:21:17 +02:00
parent 50f277ef8a
commit 2cd71a18fc
2 changed files with 2 additions and 1 deletions

View File

@@ -76,6 +76,7 @@ void CppHighlighter::highlightBlock(const QString &text)
setFormat(0, text.length(), formatForCategory(C_VISUAL_WHITESPACE)); setFormat(0, text.length(), formatForCategory(C_VISUAL_WHITESPACE));
} }
TextDocumentLayout::setFoldingIndent(currentBlock(), foldingIndent); TextDocumentLayout::setFoldingIndent(currentBlock(), foldingIndent);
TextDocumentLayout::setExpectedRawStringSuffix(currentBlock(), inheritedRawStringSuffix);
return; return;
} }

View File

@@ -1,7 +1,7 @@
auto func() auto func()
{ {
return R"(foo return R"(foo
foobar
R"notaprefix!( R"notaprefix!(
barfoobar)" R"(second)" /* comment */ R"(third)"; barfoobar)" R"(second)" /* comment */ R"(third)";
} }