Fix `cd`ing home when no matching directory in `fish`
Prior to this change, executing `z sjlk` (assuming no `sjlk` directory in your database) would result in going back to the user's home.
This commit is contained in:
parent
0d860503ae
commit
1e4a81e659
|
|
@ -18,6 +18,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- Interactive mode in `zoxide` no longer throws an error if `fzf` exits gracefully.
|
- Interactive mode in `zoxide` no longer throws an error if `fzf` exits gracefully.
|
||||||
- Canonicalize to regular paths instead of UNC paths on Windows.
|
- Canonicalize to regular paths instead of UNC paths on Windows.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- When no match is found, `fish` stays in the current directory.
|
||||||
|
|
||||||
## [0.3.1] - 2020-04-03
|
## [0.3.1] - 2020-04-03
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
||||||
|
|
@ -160,15 +160,11 @@ function {}
|
||||||
or return $status
|
or return $status
|
||||||
|
|
||||||
else
|
else
|
||||||
# FIXME: use string-collect from fish 3.1.0 once it has wider adoption
|
|
||||||
set -l IFS ''
|
|
||||||
set -l result (zoxide query $argv)
|
set -l result (zoxide query $argv)
|
||||||
|
|
||||||
if test -d $result
|
if begin; test -d $result; and string length -q -- $result; end
|
||||||
_z_cd $result
|
_z_cd $result
|
||||||
or return $status
|
or return $status
|
||||||
else if test -n "$result"
|
|
||||||
echo $result
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue