瀏覽代碼

Fixed erroneous space insertion when reformatting interpolated strings

Brian Fiete 3 周之前
父節點
當前提交
a0b7f5d1da
共有 1 個文件被更改,包括 6 次插入0 次删除
  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)
 			if (expr->mSrcStart == curSrcIdx)
 			{
 			{
 				_Flush(strIdx);
 				_Flush(strIdx);
+
+				// Avoid any additional formatting before the block
+				mExpectingNewLine = false;
+				mVirtualNewLineIdx = mNextStateModify.mWantNewLineIdx;
+				mNextStateModify.mExpectingSpace = false;
+
 				if (auto block = BfNodeDynCast<BfBlock>(expr))
 				if (auto block = BfNodeDynCast<BfBlock>(expr))
 					HandleBlock(block, true);
 					HandleBlock(block, true);
 				else
 				else