Skip to content

Commit 048d45d

Browse files
committed
Don't insert INDENT/UNINDENT without anything in between
Fixes #14061
1 parent 80ec523 commit 048d45d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/parsing/Scanners.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ object Scanners {
539539
|| nextWidth == lastWidth && (indentPrefix == MATCH || indentPrefix == CATCH) && token != CASE then
540540
if currentRegion.isOutermost then
541541
if nextWidth < lastWidth then currentRegion = topLevelRegion(nextWidth)
542-
else if !isLeadingInfixOperator(nextWidth) && !statCtdTokens.contains(lastToken) then
542+
else if !isLeadingInfixOperator(nextWidth) && !statCtdTokens.contains(lastToken) && lastToken != INDENT then
543543
currentRegion match
544544
case r: Indented =>
545545
currentRegion = r.enclosing

0 commit comments

Comments
 (0)