From ca34ccf3429dfe38628d9333f7b725deb4033ab5 Mon Sep 17 00:00:00 2001 From: vlaw Date: Fri, 28 Apr 2023 11:44:58 +0800 Subject: [PATCH] Revert "fix fish errors (#204)" This reverts commit 83fca516127bc7cb92b066b7dd355b30682298ee. --- functions/_enhancd_filepath_walk.fish | 2 +- functions/_enhancd_filter_interactive.fish | 2 +- functions/enhancd.fish | 4 ++-- src/filepath.sh | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/functions/_enhancd_filepath_walk.fish b/functions/_enhancd_filepath_walk.fish index bb1116a..e757352 100644 --- a/functions/_enhancd_filepath_walk.fish +++ b/functions/_enhancd_filepath_walk.fish @@ -1,5 +1,5 @@ function _enhancd_filepath_walk - set -a dirs $PWD (_enhancd_filepath_get_parent_dirs) + set -a dirs ($PWD _enhancd_filepath_get_parent_dirs) for dir in $dirs command find "$dir" -maxdepth 1 -type d -name '\.*' -prune -o -type d -print diff --git a/functions/_enhancd_filter_interactive.fish b/functions/_enhancd_filter_interactive.fish index a4063f1..da83926 100644 --- a/functions/_enhancd_filter_interactive.fish +++ b/functions/_enhancd_filter_interactive.fish @@ -13,7 +13,7 @@ function _enhancd_filter_interactive set -l filter (_enhancd_helper_parse_filter_string "$ENHANCD_FILTER") set -l count (echo "$stdin" | _enhancd_command_grep -c "") - if test "$ENHANCD_USE_ABBREV" = true + if test $ENHANCD_USE_ABBREV = true function _enhancd_filter_interactive_abbrev while read -l line string replace --regex "^$HOME" "~" "$line" diff --git a/functions/enhancd.fish b/functions/enhancd.fish index b7e30fd..056d7b3 100644 --- a/functions/enhancd.fish +++ b/functions/enhancd.fish @@ -74,9 +74,9 @@ function enhancd if test -n $format; and not string match --quiet '*%*' $format echo "$opt: 'format' label needs to include '%' (selected line)" >&2 return 1 - end + fi _enhancd_command_run "$func" "$arg" | _enhancd_filter_interactive - set -l selected + set -l seleted if test -z $format set selected (_enhancd_command_run "$func" | _enhancd_filter_interactive) else diff --git a/src/filepath.sh b/src/filepath.sh index 6106f2b..147e666 100644 --- a/src/filepath.sh +++ b/src/filepath.sh @@ -13,9 +13,9 @@ __enhancd::filepath::walk() { local -a dirs - # __enhancd::filepath::get_parent_dirs does not return $PWD itself, - # so add it to the array explicitly - dirs=( "${PWD}" "$(__enhancd::filepath::get_parent_dirs "${1:-${PWD}}")" ) + # __enhancd::filepath::get_parent_dirs does not return $PWD itself + # so add it to array expressly + dirs=( "${PWD}" $(__enhancd::filepath::get_parent_dirs "${1:-${PWD}}") ) for dir in "${dirs[@]}" do