diff --git a/README.md b/README.md index 0486ba1..7567d3d 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ The current working directory is the most important part of any shell prompt. Ti ![pwd][] -When the full directory doesn't fit, the leftmost segment is truncated to its shortest unique prefix. In the example above, `Documents` becomes `Doc` instead of `D` because that could be confused with `Downloads`. Important segments are bold and never truncated. These include the first and the last segments, roots of Git repositories etc. +When the full directory doesn't fit, the leftmost segment is truncated to its shortest unique prefix. In the example above, `Documents` becomes `Doc` instead of `D` because that could be confused with `Downloads`. Important segments are bold and never truncated. These include the last segment, root of a Git repository etc. _Tip_: If you copy-paste a truncated path and hit tab, it will complete to the original. diff --git a/functions/_tide_pwd.fish b/functions/_tide_pwd.fish index 6b55973..88c6e02 100644 --- a/functions/_tide_pwd.fish +++ b/functions/_tide_pwd.fish @@ -13,10 +13,7 @@ eval "function _tide_pwd set -f icon $home_icon end - # Anchor first and last directories (which may be the same) - test -n \"\$split_pwd[1]\" && # ~/foo/bar, hightlight ~ OR /foo/bar, hightlight foo not empty string - set -l split_output \"$reset_to_color_dirs\$icon$color_anchors\$split_pwd[1]$reset_to_color_dirs\" \$split_pwd[2..] || - set -l split_output \"$reset_to_color_dirs\$icon\" \"$color_anchors\$split_pwd[2]$reset_to_color_dirs\" \$split_pwd[3..] + set -l split_output \"\$icon\$split_pwd[1]\" \$split_pwd[2..] set split_output[-1] \"$color_anchors\$split_output[-1]$reset_to_color_dirs\" string join / \$split_output | string length -V | read -g _tide_pwd_len @@ -39,5 +36,5 @@ eval "function _tide_pwd end end - string join -- / \$split_output + string join -- / \"$reset_to_color_dirs\$split_output[1]\" \$split_output[2..] end"