diff --git a/IDEHelper/Compiler/BfPrinter.cpp b/IDEHelper/Compiler/BfPrinter.cpp index 36c9bc60..9ccd1aa3 100644 --- a/IDEHelper/Compiler/BfPrinter.cpp +++ b/IDEHelper/Compiler/BfPrinter.cpp @@ -1337,6 +1337,8 @@ void BfPrinter::Visit(BfLiteralExpression* literalExpr) { int srcLineStart = 0; + bool startsOnEmptyLine = true; + int checkIdx = literalExpr->GetSrcStart() - 1; while (checkIdx >= 0) { @@ -1346,12 +1348,19 @@ void BfPrinter::Visit(BfLiteralExpression* literalExpr) srcLineStart = checkIdx + 1; break; } + if ((c != '\t') && (c != ' ')) + startsOnEmptyLine = false; checkIdx--; } - + int queuedSpaceCount = mQueuedSpaceCount; FlushIndent(); + if (!startsOnEmptyLine) + { + queuedSpaceCount = mCurIndentLevel * mTabSize; + } + for (int i = literalExpr->GetSrcStart(); i < (int)literalExpr->GetSrcEnd(); i++) { char c = sourceData->mSrc[i]; @@ -1379,6 +1388,9 @@ void BfPrinter::Visit(BfLiteralExpression* literalExpr) } } +// if (!startsOnEmptyLine) +// mCurIndentLevel--; + return; } }