Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix fish errors #204

Merged
merged 1 commit into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion functions/_enhancd_filepath_walk.fish
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion functions/_enhancd_filter_interactive.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions functions/enhancd.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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
fi
end
_enhancd_command_run "$func" "$arg" | _enhancd_filter_interactive
set -l seleted
set -l selected
if test -z $format
set selected (_enhancd_command_run "$func" | _enhancd_filter_interactive)
else
Expand Down
6 changes: 3 additions & 3 deletions src/filepath.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ __enhancd::filepath::walk()
{
local -a dirs

# __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}}") )
# __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}}")" )

for dir in "${dirs[@]}"
do
Expand Down