Compare commits

...

2 Commits

Author SHA1 Message Date
Ajeet D'Souza 5b2c9222f9
pwsh: handle queries that look like args (#760) 2024-03-16 12:30:19 +05:30
Anselm Schüler 88d494fc2d
Fix handling of directories that look like flags in fish (#605) 2024-03-16 11:31:42 +05:30
3 changed files with 7 additions and 6 deletions

View File

@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- fish: detect infinite loop when using `alias cd=z`.
- fish / PowerShell: handle queries that look like args (e.g. `z -x`).
## [0.9.4] - 2024-02-21

View File

@ -82,7 +82,7 @@ function __zoxide_z
__zoxide_cd -
else if test $argc -eq 1 -a -d $argv[1]
__zoxide_cd $argv[1]
else if set -l result (string replace --regex $__zoxide_z_prefix_regex '' $argv[-1]); and test -n $result
else if set -l result (string replace --regex -- $__zoxide_z_prefix_regex '' $argv[-1]); and test -n $result
__zoxide_cd $result
else
set -l result (command zoxide query --exclude (__zoxide_pwd) -- $argv)

View File

@ -62,7 +62,7 @@ function global:__zoxide_cd($dir, $literal) {
function global:__zoxide_hook {
$result = __zoxide_pwd
if ($null -ne $result) {
zoxide add -- $result
zoxide add "--" $result
}
}
{%- else if hook == InitHook::Pwd -%}
@ -72,7 +72,7 @@ function global:__zoxide_hook {
$result = __zoxide_pwd
if ($result -ne $global:__zoxide_oldpwd) {
if ($null -ne $result) {
zoxide add -- $result
zoxide add "--" $result
}
$global:__zoxide_oldpwd = $result
}
@ -112,10 +112,10 @@ function global:__zoxide_z {
else {
$result = __zoxide_pwd
if ($null -ne $result) {
$result = __zoxide_bin query --exclude $result -- @args
$result = __zoxide_bin query --exclude $result "--" @args
}
else {
$result = __zoxide_bin query -- @args
$result = __zoxide_bin query "--" @args
}
if ($LASTEXITCODE -eq 0) {
__zoxide_cd $result $true
@ -125,7 +125,7 @@ function global:__zoxide_z {
# Jump to a directory using interactive search.
function global:__zoxide_zi {
$result = __zoxide_bin query -i -- @args
$result = __zoxide_bin query -i "--" @args
if ($LASTEXITCODE -eq 0) {
__zoxide_cd $result $true
}