fishy: fix one-level directory bug and bad array assignment in zsh 5.0.1
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
# ZSH Theme emulating the Fish shell's default prompt.
|
# ZSH Theme emulating the Fish shell's default prompt.
|
||||||
|
|
||||||
_fishy_collapsed_wd() {
|
_fishy_collapsed_wd() {
|
||||||
local -a pwd=("${(s:/:)PWD/#$HOME/~}")
|
local i pwd
|
||||||
|
pwd=("${(s:/:)PWD/#$HOME/~}")
|
||||||
|
if (( $#pwd > 1 )); then
|
||||||
for i in {1..$(($#pwd-1))}; do
|
for i in {1..$(($#pwd-1))}; do
|
||||||
if [[ "$pwd[$i]" = .* ]]; then
|
if [[ "$pwd[$i]" = .* ]]; then
|
||||||
pwd[$i]="${${pwd[$i]}[1,2]}"
|
pwd[$i]="${${pwd[$i]}[1,2]}"
|
||||||
@@ -9,6 +11,7 @@ _fishy_collapsed_wd() {
|
|||||||
pwd[$i]="${${pwd[$i]}[1]}"
|
pwd[$i]="${${pwd[$i]}[1]}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
echo "${(j:/:)pwd}"
|
echo "${(j:/:)pwd}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user