Skip to content

Commit 82966d7

Browse files
committed
fix: redirection pipe formatting
1 parent 353e353 commit 82966d7

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

README.md

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

1111
## Status
1212

13-
* Supposed to work well with all language features of nushell v0.107
13+
* Supposed to work well with all language features of nushell v0.108
1414
* Except for some known issues of `tree-sitter-nu`
1515

1616
> [!NOTE]

languages/nu.scm

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,17 @@
5858
] @prepend_space @append_space
5959

6060
(pipeline
61-
"|" @append_space @prepend_input_softline
61+
[
62+
"err>|"
63+
"out>|"
64+
"e>|"
65+
"o>|"
66+
"err+out>|"
67+
"out+err>|"
68+
"o+e>|"
69+
"e+o>|"
70+
"|"
71+
] @append_space @prepend_input_softline
6272
)
6373

6474
;; add spaces to left & right sides of operators
@@ -261,7 +271,7 @@
261271
"}"? @prepend_spaced_softline
262272
)
263273

264-
(match_pattern "|" @prepend_spaced_softline @append_space )
274+
(match_pattern "|" @prepend_spaced_softline @append_space)
265275

266276
;; data structures
267277
(command_list

test/expected_command.nu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# local command
2-
ls | get -i name
2+
ls e+o>| get -i name
33
| length; ls # multiline command
44
| length
55
# external command
@@ -10,4 +10,4 @@ ls | get -i name
1010
FOO=BAR BAR=BAZ ^$cmd --arg1=val1 -arg2 arg=value arg=($arg3)
1111
cat unknown.txt o+e> (null-device)
1212

13-
$hash | $in + "\n" out>> $NUENV_FILE
13+
$hash err>| $in + "\n" out>> $NUENV_FILE

test/input_command.nu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# local command
2-
ls | get -i name
2+
ls e+o>| get -i name
33
| length; ls # multiline command
44
| length
55
# external command
@@ -8,4 +8,4 @@ ls | get -i name
88
FOO=BAR BAR=BAZ ^$cmd --arg1=val1 -arg2 arg=value arg=($arg3)
99
cat unknown.txt o+e> (null-device)
1010

11-
$hash | $in + "\n" out>> $NUENV_FILE
11+
$hash err>| $in + "\n" out>> $NUENV_FILE

0 commit comments

Comments
 (0)