Support z - in Nushell

This commit is contained in:
Ajeet D'Souza 2022-08-12 12:43:41 +05:30
parent 535762b80a
commit b0c899b99f
6 changed files with 9 additions and 6 deletions

View File

@ -42,8 +42,8 @@ jobs:
- name: Setup cache
uses: Swatinem/rust-cache@v1
if:
${{ matrix.os == 'windows-latest' }}
with:
key: ${{ matrix.target }}
- run: cargo xtask ci
if: ${{ matrix.os == 'windows-latest' }}

View File

@ -71,6 +71,8 @@ jobs:
- name: Setup cache
uses: Swatinem/rust-cache@v1
with:
key: ${{ matrix.target }}
- name: Build binary
uses: actions-rs/cargo@v1

View File

@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Bash/Fish/Posix/Zsh: paths on Cygwin.
- Fish: completions not working on certain systems.
- Bash: completions not escaping spaces correctly.
- Nushell: support for `z -`.
## [0.8.1] - 2021-04-23

View File

@ -212,7 +212,7 @@ Now, add this to the end of your config file (find it by running
source ~/.zoxide.nu
```
Note: zoxide only supports Nushell v0.61.0 and above.
Note: zoxide only supports Nushell v0.62.0 and above.
</details>

View File

@ -45,7 +45,7 @@ Now, add this to the end of your config file (find it by running
\fBsource ~/.zoxide.nu\fR
.fi
.sp
Note: zoxide only supports Nushell v0.61.0 and above.
Note: zoxide only supports Nushell v0.62.0 and above.
.TP
.B powershell
Add this to your configuration (find it by running \fBecho $profile\fR in

View File

@ -44,7 +44,7 @@ echo "zoxide: PWD hooks are not supported on Nushell.\nUse `zoxide init nushell
def-env __zoxide_z [...rest:string] {
# `z -` does not work yet, see https://github.com/nushell/nushell/issues/4769
let arg0 = ($rest | append '~').0
let path = if ($rest | length) <= 1 && ($arg0 | path expand | path type) == dir {
let path = if (($rest | length) <= 1) && ($arg0 == '-' || ($arg0 | path expand | path type) == dir) {
$arg0
} else {
(zoxide query --exclude $env.PWD -- $rest | str trim -r -c "\n")
@ -89,4 +89,4 @@ alias {{cmd}}i = __zoxide_zi
#
# source ~/.zoxide.nu
#
# Note: zoxide only supports Nushell v0.61.0 and above.
# Note: zoxide only supports Nushell v0.62.0 and above.