Skip to content

Commit

Permalink
Update indentation.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Bernet authored Jun 26, 2023
1 parent 9819742 commit 28d207d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions docs/_docs/reference/other-new-features/indentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ Indentation can be mixed freely with braces `{...}`, as well as brackets `[...]`
For instance, consider:
```scala
{
val x = f(x: Int, y =>
val x = 4
f(x: Int, y =>
x * (
y + 1
) +
Expand All @@ -270,13 +271,13 @@ For instance, consider:
)
}
```
- Here, the indentation width of the region enclosed by the braces is 3 (i.e. the indentation width of the
- Here, the indentation width of the region enclosed by the braces is 2 (i.e. the indentation width of the
statement starting with `val`).
- The indentation width of the region in parentheses that follows `f` is also 3, since the opening
- The indentation width of the region in parentheses that follows `f` is also 2, since the opening
parenthesis is not at the end of a line.
- The indentation width of the region in parentheses around `y + 1` is 9
- The indentation width of the region in parentheses around `y + 1` is 6
(i.e. the indentation width of `y + 1`).
- Finally, the indentation width of the last region in parentheses starting with `(x` is 6 (i.e. the indentation width of the indented region following the `=>`.
- Finally, the indentation width of the last region in parentheses starting with `(x` is 4 (i.e. the indentation width of the indented region following the `=>`.
## Special Treatment of Case Clauses
Expand Down

0 comments on commit 28d207d

Please sign in to comment.