From c6ac773b9a2d6fc5cb581cd56785525d0a352a4a Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 18 Aug 2021 14:57:19 +0300 Subject: CppTools: Fix indentation of plain strings Raw strings should not be indented, but old-style strings still should. Amends commit ddf7f5f232d70c8598654fdad08af3064f95903f. Fixes: QTCREATORBUG-25817 Change-Id: I7836388efb2d19b8b898c7463c7fa2d2077e80b2 Reviewed-by: Christian Kandeler --- src/plugins/cpptools/cppqtstyleindenter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/plugins/cpptools/cppqtstyleindenter.cpp') diff --git a/src/plugins/cpptools/cppqtstyleindenter.cpp b/src/plugins/cpptools/cppqtstyleindenter.cpp index 3eebaf1321..cc3f272c45 100644 --- a/src/plugins/cpptools/cppqtstyleindenter.cpp +++ b/src/plugins/cpptools/cppqtstyleindenter.cpp @@ -99,7 +99,7 @@ void CppQtStyleIndenter::indentBlock(const QTextBlock &block, QtStyleCodeFormatter codeFormatter(tabSettings, codeStyleSettings()); codeFormatter.updateStateUntil(block); - if (codeFormatter.isInStringLiteral(block)) + if (codeFormatter.isInRawStringLiteral(block)) return; int indent; int padding; @@ -137,7 +137,7 @@ void CppQtStyleIndenter::indent(const QTextCursor &cursor, QTextCursor tc = cursor; tc.beginEditBlock(); do { - if (!codeFormatter.isInStringLiteral(block)) { + if (!codeFormatter.isInRawStringLiteral(block)) { int indent; int padding; codeFormatter.indentFor(block, &indent, &padding); -- cgit v1.2.1