Skip to content

Commit 3e2d681

Browse files
committed
fix: ctrl_if in expr_parenthesized
1 parent 68572e8 commit 3e2d681

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

languages/nu.scm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
(stmt_mut "=" @prepend_space)
4242
(stmt_const "=" @prepend_space)
4343

44-
(param_value "=" @append_space)
44+
(param_value "=" @append_space @prepend_space)
4545

4646
(assignment
4747
opr: _
@@ -145,7 +145,7 @@
145145
(parameter_pipes)? @do_nothing
146146
)
147147

148-
;; space/new-line between parameters
148+
;; space/newline between parameters
149149
(parameter_pipes
150150
(
151151
(parameter) @append_space
@@ -189,7 +189,7 @@
189189
(decl_extern (_) @prepend_space)
190190
(decl_module (_) @prepend_space)
191191

192-
;; new-line
192+
;; newline
193193
(comment) @prepend_input_softline @append_hardline
194194

195195
;; TODO: pseudo scope_id to cope with
@@ -219,6 +219,8 @@
219219
(ctrl_if
220220
"if" @append_space
221221
condition: _ @append_space
222+
then_branch: _
223+
"else"? @prepend_input_softline
222224
)
223225

224226
(ctrl_for

test/expected_exe.nu

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ def workspace_modification_args [
5656
# use listener's label to store last focused space id
5757
let focused_sid = (aerospace list-workspaces --focused)
5858
let ids_to_modify = (
59-
if ($last_sid | is-empty) {(aerospace list-workspaces --all | lines)} else {
59+
if ($last_sid | is-empty) {(aerospace list-workspaces --all | lines)}
60+
else {
6061
[$focused_sid $last_sid]
6162
}
6263
)

0 commit comments

Comments
 (0)