From d41e20959d304a3983b57189563807f88a9d893a Mon Sep 17 00:00:00 2001 From: Ilan Cosman Date: Sat, 6 Mar 2021 11:58:49 -0800 Subject: [PATCH] Fix pwd markers --- functions/_tide_item_pwd.fish | 2 +- tests/_tide_item_pwd.test.fish | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/_tide_item_pwd.fish b/functions/_tide_item_pwd.fish index d34eaa6..2408126 100644 --- a/functions/_tide_item_pwd.fish +++ b/functions/_tide_item_pwd.fish @@ -20,7 +20,7 @@ function _tide_item_pwd set i (math $i + 1) # This keeps us from using seq # Returns true if any markers exist in splitPwd[$i], or if anchorDirs contains i - if test -z false (string split -m 2 " " -- "-o -e "$parentDir/$tide_pwd_markers) || contains $i $anchorDirs + if test -z false (string split -m 2 " " -- "-o -e "$parentDir/$splitPwd[$i]/$tide_pwd_markers) || contains $i $anchorDirs set splitPwdForOutput[$i] $colorAnchors$splitPwd[$i]$keepBackgroundColor$colorDirs else if test (string join -- '/' $splitPwdForLength | string length) -gt $pwdMaxLength while set -l truncationLength (math $truncationLength + 1) && diff --git a/tests/_tide_item_pwd.test.fish b/tests/_tide_item_pwd.test.fish index 8247137..92576a3 100644 --- a/tests/_tide_item_pwd.test.fish +++ b/tests/_tide_item_pwd.test.fish @@ -47,6 +47,6 @@ rm -r ~/alfa/bratwurst # Markers mkdir -p ~/alfa/.git -_pwd "$longDir" # CHECK: ~/a/bravo/c/d/e/f/g/h/india/juliett/kilo/lima/mike/november/oscar/papa +_pwd "$longDir" # CHECK: ~/alfa/b/c/d/e/f/g/h/india/juliett/kilo/lima/mike/november/oscar/papa rm -r ~/alfa