1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-01-12 22:18:00 +08:00

Compare commits

..

No commits in common. "9bfa3395f34f63d14945e01c45c72ec43d372dfa" and "d2d5155d41cbe183ef172fef1e83a29d116a5af6" have entirely different histories.

3 changed files with 8 additions and 9 deletions

View File

@ -28,7 +28,7 @@ dependencies:
plugins/wd:
repo: mfaerevaag/wd
branch: master
version: tag:v0.9.1
version: tag:v0.9.0
precopy: |
set -e
rm -r test

View File

@ -1,5 +1,5 @@
certifi==2024.8.30
charset-normalizer==3.4.0
charset-normalizer==3.3.2
idna==3.10
PyYAML==6.0.2
requests==2.32.3

View File

@ -8,7 +8,7 @@
# @github.com/mfaerevaag/wd
# version
readonly WD_VERSION=0.9.1
readonly WD_VERSION=0.9.0
# 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,7 +344,6 @@ 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
@ -359,12 +358,12 @@ wd_show()
local wd_matches
wd_matches=()
# do a reverse lookup to check whether PWD is in $points
show_pwd="${PWD/$HOME/~}"
if [[ ${points[(r)$show_pwd]} == "$show_pwd" ]]
PWD="${PWD/$HOME/~}"
if [[ ${points[(r)$PWD]} == "$PWD" ]]
then
for name in ${(k)points}
do
if [[ $points[$name] == "$show_pwd" ]]
if [[ $points[$name] == "$PWD" ]]
then
wd_matches[$(($#wd_matches+1))]=$name
fi
@ -372,7 +371,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 $show_pwd"
wd_print_msg "$WD_YELLOW" "No warp point to $(echo "$PWD" | sed "s:$HOME:~:")"
fi
fi
}