summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com>2024-10-13 21:10:29 +0200
committerGitHub <noreply@github.com>2024-10-13 21:10:29 +0200
commita82f6c79abdb888f6f63ee2ddc77742a84c28486 (patch)
treed6e510b68247004e609e50a2b52a21c38bd61c5f /plugins
parentd2d5155d41cbe183ef172fef1e83a29d116a5af6 (diff)
downloadzsh-a82f6c79abdb888f6f63ee2ddc77742a84c28486.tar.gz
zsh-a82f6c79abdb888f6f63ee2ddc77742a84c28486.tar.bz2
zsh-a82f6c79abdb888f6f63ee2ddc77742a84c28486.zip
feat(wd): update to f0f47b71 (#12747)
Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com>
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/wd/wd.sh13
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh
index ddd31e6f6..66435a2a6 100755
--- a/plugins/wd/wd.sh
+++ b/plugins/wd/wd.sh
@@ -8,7 +8,7 @@
# @github.com/mfaerevaag/wd
# version
-readonly WD_VERSION=0.9.0
+readonly WD_VERSION=0.9.1
# colors
readonly WD_BLUE="\033[96m"
@@ -59,7 +59,7 @@ wd_print_msg()
then
local color="${1:-$WD_BLUE}" # Default to blue if no color is provided
local msg="$2"
-
+
if [[ -z "$msg" ]]; then
print "${WD_RED}*${WD_NOC} Could not print message. Sorry!"
else
@@ -344,6 +344,7 @@ wd_path()
wd_show()
{
local name_arg=$1
+ local show_pwd
# if there's an argument we look up the value
if [[ -n $name_arg ]]
then
@@ -358,12 +359,12 @@ wd_show()
local wd_matches
wd_matches=()
# do a reverse lookup to check whether PWD is in $points
- PWD="${PWD/$HOME/~}"
- if [[ ${points[(r)$PWD]} == "$PWD" ]]
+ show_pwd="${PWD/$HOME/~}"
+ if [[ ${points[(r)$show_pwd]} == "$show_pwd" ]]
then
for name in ${(k)points}
do
- if [[ $points[$name] == "$PWD" ]]
+ if [[ $points[$name] == "$show_pwd" ]]
then
wd_matches[$(($#wd_matches+1))]=$name
fi
@@ -371,7 +372,7 @@ wd_show()
wd_print_msg "$WD_BLUE" "$#wd_matches warp point(s) to current directory: ${WD_GREEN}$wd_matches${WD_NOC}"
else
- wd_print_msg "$WD_YELLOW" "No warp point to $(echo "$PWD" | sed "s:$HOME:~:")"
+ wd_print_msg "$WD_YELLOW" "No warp point to $show_pwd"
fi
fi
}