Skip to content

Commit

Permalink
fix: ctrl_do in expr_parenthesized
Browse files Browse the repository at this point in the history
  • Loading branch information
blindFS committed Dec 22, 2024
1 parent 3e2d681 commit b9a34a3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion languages.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
extensions = ["nu"],
grammar.source.git = {
git = "https://github.com/nushell/tree-sitter-nu.git",
rev = "f85d2481616537d1d54894bc278d64b24581ea5c",
rev = "755efd545d39e23418ce6f96f2a8600ff1a7e74d",
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion languages/nu.scm
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
(default_arm)? @prepend_spaced_softline
)

(ctrl_do (_) @prepend_space)
(ctrl_do (_) @prepend_input_softline)

;; data structures
(command_list
Expand Down
9 changes: 6 additions & 3 deletions test/expected_decl.nu
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ extern hi [
# env
hide-env ABC
with-env { ABC: 'hello' } {
do -i --env {|foo, bar|
print $env.ABC
} foo bar
(
do -i --env {|foo, bar|
print $env.ABC
}
foo bar
)
}

# closure
Expand Down
5 changes: 4 additions & 1 deletion test/input_decl.nu
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ extern hi [name: string --long (-s) # flags
# env
hide-env ABC
with-env {ABC: 'hello'} {
(
do -i --env {|foo, bar | print $env.ABC
} foo bar
}
foo bar
)
}

# closure
Expand Down

0 comments on commit b9a34a3

Please sign in to comment.