mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-12 20:21:02 +01:00
feat(wd): update to 498695ff (#12507)
Closes #12489 Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com>
This commit is contained in:
parent
6fe78e0629
commit
677f5010da
2 changed files with 7 additions and 5 deletions
2
.github/dependencies.yml
vendored
2
.github/dependencies.yml
vendored
|
@ -39,7 +39,7 @@ dependencies:
|
||||||
plugins/wd:
|
plugins/wd:
|
||||||
repo: mfaerevaag/wd
|
repo: mfaerevaag/wd
|
||||||
branch: master
|
branch: master
|
||||||
version: tag:v0.7.0
|
version: tag:v0.7.1
|
||||||
precopy: |
|
precopy: |
|
||||||
set -e
|
set -e
|
||||||
rm -r test
|
rm -r test
|
||||||
|
|
|
@ -261,9 +261,9 @@ wd_browse() {
|
||||||
local entries=("${(@f)$(sed "s:${HOME}:~:g" "$WD_CONFIG" | awk -F ':' '{print $1 " -> " $2}')}")
|
local entries=("${(@f)$(sed "s:${HOME}:~:g" "$WD_CONFIG" | awk -F ':' '{print $1 " -> " $2}')}")
|
||||||
local script_path="${${(%):-%x}:h}"
|
local script_path="${${(%):-%x}:h}"
|
||||||
local wd_remove_output=$(mktemp "${TMPDIR:-/tmp}/wd.XXXXXXXXXX")
|
local wd_remove_output=$(mktemp "${TMPDIR:-/tmp}/wd.XXXXXXXXXX")
|
||||||
local entries_with_headers=("All warp points:" "Press enter to select. Press delete to remove" "${entries[@]}")
|
entries=("All warp points:" "Press enter to select. Press delete to remove" "${entries[@]}")
|
||||||
local fzf_bind="delete:execute(echo {} | awk -F ' -> ' '{print \$1}' | xargs -I {} "$script_path/wd.sh" rm {} > "$wd_remove_output")+abort"
|
local fzf_bind="delete:execute(echo {} | awk -F ' -> ' '{print \$1}' | xargs -I {} "$script_path/wd.sh" rm {} > "$wd_remove_output")+abort"
|
||||||
local fzf_command=$(printf '%s\n' "${entries_with_headers[@]}" | fzf --height 100% --reverse --header-lines=2 --bind="$fzf_bind")
|
local selected_entry=$(printf '%s\n' "${entries[@]}" | fzf --height 100% --reverse --header-lines=2 --bind="$fzf_bind")
|
||||||
if [[ -e $wd_remove_output ]]; then
|
if [[ -e $wd_remove_output ]]; then
|
||||||
cat "$wd_remove_output"
|
cat "$wd_remove_output"
|
||||||
rm "$wd_remove_output"
|
rm "$wd_remove_output"
|
||||||
|
@ -287,8 +287,10 @@ wd_browse_widget() {
|
||||||
}
|
}
|
||||||
|
|
||||||
wd_restore_buffer() {
|
wd_restore_buffer() {
|
||||||
BUFFER=$saved_buffer
|
if [[ -n $saved_buffer ]]; then
|
||||||
CURSOR=$saved_cursor
|
BUFFER=$saved_buffer
|
||||||
|
CURSOR=$saved_cursor
|
||||||
|
fi
|
||||||
saved_buffer=
|
saved_buffer=
|
||||||
saved_cursor=1
|
saved_cursor=1
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue