@@ -546,8 +546,7 @@ object Scanners {
546546 if indentSyntax && isNewLine then
547547 val nextWidth = indentWidth(next.offset)
548548 val lastWidth = currentRegion match
549- case r : Indented => r.width
550- case r : InBraces => r.width
549+ case r : IndentSignificantRegion => r.indentWidth
551550 case _ => nextWidth
552551
553552 if lastWidth < nextWidth then
@@ -1331,12 +1330,16 @@ object Scanners {
13311330 def enclosing : Region = outer.asInstanceOf [Region ]
13321331
13331332 /** If this is an InBraces or Indented region, its indentation width, or Zero otherwise */
1334- def indentWidth = IndentWidth .Zero
1333+ def indentWidth : IndentWidth = IndentWidth .Zero
13351334 }
13361335
13371336 case class InString (multiLine : Boolean , outer : Region ) extends Region
13381337 case class InParens (prefix : Token , outer : Region ) extends Region
1339- case class InBraces (var width : IndentWidth | Null , outer : Region ) extends Region {
1338+
1339+ abstract class IndentSignificantRegion extends Region
1340+
1341+ case class InBraces (var width : IndentWidth | Null , outer : Region )
1342+ extends IndentSignificantRegion {
13401343 override def indentWidth = width
13411344 }
13421345
@@ -1345,7 +1348,8 @@ object Scanners {
13451348 * @param others Other indendation widths > width of lines in the same region
13461349 * @param prefix The token before the initial <indent> of the region
13471350 */
1348- case class Indented (width : IndentWidth , others : Set [IndentWidth ], prefix : Token , outer : Region | Null ) extends Region {
1351+ case class Indented (width : IndentWidth , others : Set [IndentWidth ], prefix : Token , outer : Region | Null )
1352+ extends IndentSignificantRegion {
13491353 override def indentWidth = width
13501354 }
13511355
0 commit comments