From 2102d10896fe14e912ed6ed8075bb0ddd3a5bc6a Mon Sep 17 00:00:00 2001 From: Markus Færevaag Date: Wed, 1 Nov 2017 22:03:34 +0900 Subject: [wd] Update wd plugin to latest version (#6371) * [wd] Update wd plugin to v0.4.3 * [wd] Update wd plugin to v0.4.4 --- plugins/wd/_wd.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'plugins/wd/_wd.sh') diff --git a/plugins/wd/_wd.sh b/plugins/wd/_wd.sh index b67f4a1e2..65fa1ddde 100644 --- a/plugins/wd/_wd.sh +++ b/plugins/wd/_wd.sh @@ -16,6 +16,19 @@ function _wd() { warp_points=( "${(f)mapfile[$CONFIG]//$HOME/~}" ) + typeset -A points + while read -r line + do + arr=(${(s,:,)line}) + name=${arr[1]} + path=${arr[2]} + + # replace ~ from path to fix completion (#17) + path=${path/#\~/$HOME} + + points[$name]=$path + done < $CONFIG + commands=( 'add:Adds the current working directory to your warp points' 'add!:Overwrites existing warp point' @@ -34,13 +47,15 @@ function _wd() { '1: :->first_arg' \ '2: :->second_arg' && ret=0 + local target=$words[2] + case $state in first_arg) _describe -t warp_points "Warp points" warp_points && ret=0 _describe -t commands "Commands" commands && ret=0 ;; second_arg) - case $words[2] in + case $target in add\!|rm) _describe -t points "Warp points" warp_points && ret=0 ;; @@ -56,6 +71,10 @@ function _wd() { path) _describe -t points "Warp points" warp_points && ret=0 ;; + *) + # complete sub directories from the warp point + _path_files -W "(${points[$target]})" -/ && ret=0 + ;; esac ;; esac -- cgit v1.2.3-70-g09d2 From 46062e25cc4ebae21465cac4680ce284dcf475a7 Mon Sep 17 00:00:00 2001 From: Markus Færevaag Date: Wed, 8 Nov 2017 00:40:24 +0900 Subject: [wd] Update wd plugin to latest (#6383) * Update wd plugin to v0.4.5 * [wd] Update wd plugin to v0.4.6 --- plugins/wd/_wd.sh | 6 +++--- plugins/wd/wd.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/wd/_wd.sh') diff --git a/plugins/wd/_wd.sh b/plugins/wd/_wd.sh index 65fa1ddde..d5419d629 100644 --- a/plugins/wd/_wd.sh +++ b/plugins/wd/_wd.sh @@ -21,12 +21,12 @@ function _wd() { do arr=(${(s,:,)line}) name=${arr[1]} - path=${arr[2]} + target_path=${arr[2]} # replace ~ from path to fix completion (#17) - path=${path/#\~/$HOME} + target_path=${path/#\~/$HOME} - points[$name]=$path + points[$name]=$target_path done < $CONFIG commands=( diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh index c330dd358..3d68583f1 100755 --- a/plugins/wd/wd.sh +++ b/plugins/wd/wd.sh @@ -8,7 +8,7 @@ # @github.com/mfaerevaag/wd # version -readonly WD_VERSION=0.4.4 +readonly WD_VERSION=0.4.6 # colors readonly WD_BLUE="\033[96m" -- cgit v1.2.3-70-g09d2 From dcb8101fdeded9aa4310d867f9c809c976a0f1cb Mon Sep 17 00:00:00 2001 From: Markus Færevaag Date: Fri, 10 Nov 2017 08:10:33 +0900 Subject: [wd] Fix update of wd plugin to v0.4.6 (#6407) --- plugins/wd/_wd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/wd/_wd.sh') diff --git a/plugins/wd/_wd.sh b/plugins/wd/_wd.sh index d5419d629..4354a71f4 100644 --- a/plugins/wd/_wd.sh +++ b/plugins/wd/_wd.sh @@ -24,7 +24,7 @@ function _wd() { target_path=${arr[2]} # replace ~ from path to fix completion (#17) - target_path=${path/#\~/$HOME} + target_path=${target_path/#\~/$HOME} points[$name]=$target_path done < $CONFIG -- cgit v1.2.3-70-g09d2