Skip to content

Commit 753526b

Browse files
committed
Fix multiple match patterns in a row on a single line missing a line return
Close #87
1 parent 3a54e06 commit 753526b

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

queries/gdscript.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204

205205
(match_statement ":" @prepend_antispace)
206206
(match_body) @prepend_indent_start @append_indent_end @prepend_hardline
207-
(pattern_section ":" @prepend_antispace)
207+
(pattern_section ":" @prepend_antispace) @append_hardline
208208
(pattern_section (body) @prepend_hardline)
209209
(pattern_section "," @prepend_antispace @append_space)
210210
(pattern_guard) @prepend_space

tests/expected/match_case.gd

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,11 @@ func foo():
1818
# Conditional expression should be supported
1919
0 if true else 2:
2020
pass
21+
22+
match type:
23+
Type.LEFT:
24+
animation.play("left")
25+
Type.RIGHT:
26+
animation.play("right")
27+
_:
28+
animation.play("right")

tests/input/match_case.gd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,8 @@ func foo():
1818
# Conditional expression should be supported
1919
0 if true else 2:
2020
pass
21+
22+
match type:
23+
Type.LEFT: animation.play("left")
24+
Type.RIGHT: animation.play("right")
25+
_: animation.play("right")

0 commit comments

Comments
 (0)