Skip to content

Commit fd800d4

Browse files
committed
Fix if elif else on single lines wrapping incorrectly
Close #175
1 parent ca73bb2 commit fd800d4

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

queries/gdscript.scm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@
135135
(if_statement ":" @prepend_antispace)
136136
(elif_clause ":" @prepend_antispace)
137137
(else_clause ":" @prepend_antispace)
138+
(elif_clause) @prepend_hardline
139+
(else_clause) @prepend_hardline
138140
(for_statement "in" ":" @prepend_antispace)
139141
(while_statement ":" @prepend_antispace)
140142

tests/expected/issue_175.gd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
func test():
2+
if (prefix[1] == "X"):
3+
disabled = true
4+
elif (prefix[1] != ":"):
5+
separator = true

tests/input/issue_175.gd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
func test():
2+
if (prefix[1] == "X"): disabled = true
3+
elif (prefix[1] != ":"): separator = true

0 commit comments

Comments
 (0)