Browse Source

Fixed erroneous space insertion when reformatting interpolated strings

Brian Fiete 2 weeks ago
parent
commit
a0b7f5d1da
1 changed files with 6 additions and 0 deletions
  1. 6 0
      IDEHelper/Compiler/BfPrinter.cpp

+ 6 - 0
IDEHelper/Compiler/BfPrinter.cpp

@@ -1451,6 +1451,12 @@ void BfPrinter::Visit(BfStringInterpolationExpression* stringInterpolationExpres
 			if (expr->mSrcStart == curSrcIdx)
 			{
 				_Flush(strIdx);
+
+				// Avoid any additional formatting before the block
+				mExpectingNewLine = false;
+				mVirtualNewLineIdx = mNextStateModify.mWantNewLineIdx;
+				mNextStateModify.mExpectingSpace = false;
+
 				if (auto block = BfNodeDynCast<BfBlock>(expr))
 					HandleBlock(block, true);
 				else