Skip to content

Commit

Permalink
fishy: fix one-level directory bug and bad array assignment in zsh 5.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mcornella committed Sep 2, 2020
1 parent a7f5170 commit 7256c03
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions themes/fishy.zsh-theme
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# ZSH Theme emulating the Fish shell's default prompt.

_fishy_collapsed_wd() {
local -a pwd=("${(s:/:)PWD/#$HOME/~}")
for i in {1..$(($#pwd-1))}; do
if [[ "$pwd[$i]" = .* ]]; then
pwd[$i]="${${pwd[$i]}[1,2]}"
else
pwd[$i]="${${pwd[$i]}[1]}"
fi
done
local i pwd
pwd=("${(s:/:)PWD/#$HOME/~}")
if (( $#pwd > 1 )); then
for i in {1..$(($#pwd-1))}; do
if [[ "$pwd[$i]" = .* ]]; then
pwd[$i]="${${pwd[$i]}[1,2]}"
else
pwd[$i]="${${pwd[$i]}[1]}"
fi
done
fi
echo "${(j:/:)pwd}"
}

Expand Down

0 comments on commit 7256c03

Please sign in to comment.