Skip to content

Commit

Permalink
FormatWriter: fix rare but possible bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Oct 6, 2024
1 parent 189629c commit 0e3a6ff
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,9 @@ class FormatWriter(formatOps: FormatOps) {
val ft = floc.formatToken
idx += 1
columnShift += floc.shift
if (floc.hasBreakAfter || ft.leftHasNewline) floc
if (
floc.hasBreakAfter || ft.leftHasNewline || idx >= locations.length
) floc
else {
getAlignNonSlcOwner(ft, locations(idx)).foreach { nonSlcOwner =>
val (container, depth) =
Expand Down

0 comments on commit 0e3a6ff

Please sign in to comment.