Skip to content

Commit b9468ed

Browse files
BahexblindFS
authored andcommitted
insert space before closing brace in single line match expression
1 parent bf9307d commit b9468ed

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

languages/nu.scm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@
232232
scrutinee: _? @append_space
233233
(match_arm)? @prepend_spaced_softline
234234
(default_arm)? @prepend_spaced_softline
235+
"}"? @prepend_spaced_softline
235236
)
236237

237238
(match_pattern "|" @prepend_spaced_softline @append_space )

test/expected_ctrl.nu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ match $foo {
2525
[a b c] => 0
2626
a | b | c => 42
2727
}
28+
match $foo { null => { return "default" } $val => $val }
2829
# while
2930
mut x = 0; while $x < 10 { $x = $x + 1 }; $x # while comment
3031
# loop

test/input_ctrl.nu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ match $foo {
2525
[ a b c] => 0
2626
a|b|c => 42
2727
}
28+
match $foo {null => {return "default"} $val => $val}
2829
# while
2930
mut x = 0; while $x < 10 { $x = $x + 1 }; $x # while comment
3031
# loop

0 commit comments

Comments
 (0)