- Enhancement: Don't auto-indent in raw string.

This commit is contained in:
Roy Qu 2024-02-20 12:51:01 +08:00
parent d8e4c4d76b
commit 0faea6ac69
3 changed files with 4 additions and 1 deletions

View File

@ -44,6 +44,7 @@ Red Panda C++ Version 2.26
- Fix: Force to use debug server when debugging with lldb-mi to fix input/output on Windows.
- Fix: Can't goto definition/declaration into files that not saved.
- Fix: Expression that starts with full scoped variables might be treated as var definition.
- Enhancement: Don't auto-indent in raw string.
Red Panda C++ Version 2.25

View File

@ -40,6 +40,8 @@ namespace QSynedit {
if (editor->syntaxer()->language() != ProgrammingLanguage::CPP)
return indentSpaces;
SyntaxState rangePreceeding = editor->document()->getSyntaxState(startLine-1);
if (rangePreceeding.state == CppSyntaxer::RangeState::rsRawStringNotEscaping)
return 0;
if (addIndent) {
// QString trimmedS = s.trimmed();
QString trimmedLineText = lineText.trimmed();

View File

@ -23,6 +23,7 @@ namespace QSynedit {
class CppSyntaxer: public Syntaxer
{
public:
enum class TokenId {
Comment,
Directive,
@ -53,7 +54,6 @@ class CppSyntaxer: public Syntaxer
rsDefineIdentifier, rsDefineRemaining,
};
public:
explicit CppSyntaxer();
CppSyntaxer(const CppSyntaxer&)=delete;
CppSyntaxer operator=(const CppSyntaxer&)=delete;