Revert "Fix cd completions if a directory exists in $CDPATH and $PWD"

That's not what happens - I had set CDPATH to start with ".".

See #4484.

This reverts commit 1af38d69a8.
This commit is contained in:
Fabian Homborg 2017-10-16 19:33:38 +02:00
parent a9283803d4
commit d18b0be518

View file

@ -30,14 +30,9 @@ function __fish_complete_cd -d "Completions for the cd command"
set -l desc (string replace -r -- "^$HOME" "~" "$cdpath") set -l desc (string replace -r -- "^$HOME" "~" "$cdpath")
# This assumes the CDPATH component itself is cd-able. # This assumes the CDPATH component itself is cd-able.
for d in $cdpath/$token*/ for d in $cdpath/$token*/
set -l withoutcdpath (string replace -- "$cdpath/" "" $d)
# Skip if the path exists in the current directory, since that's what `cd` will use.
if test -d "$withoutcdpath" -a -x "$withoutcdpath"
continue
end
# Remove the cdpath component again. # Remove the cdpath component again.
test -x $d test -x $d
and printf "%s\tCDPATH %s\n" "$withoutcdpath" $desc and printf "%s\tCDPATH %s\n" (string replace -r "^$cdpath/" "" -- $d) $desc
end end
end end
end end