From 9a9a86cc94d8ce8f7eddcfdbe143ff0ec7b9f846 Mon Sep 17 00:00:00 2001 From: Ilan Cosman Date: Tue, 9 Jun 2020 14:43:43 -0700 Subject: [PATCH] Update README, fix minor bugs --- README.md | 1 + conf.d/_tide_pwd.fish | 2 +- conf.d/_tide_pwd_var_change.fish | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 80c175d..ec8e742 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,7 @@ Tide's git capabilities are inherited from fish's built-in [fish_git_prompt](htt | pwd_color_anchors | color of anchors | 00AFFF | | pwd_truncate_margin | number of columns distance to maintain between pwd and edge of terminal | 10 | | pwd_color_truncated_dirs | color of truncated directories | 8787AF | +| pwd_max_dirs | max number of directories to display, setting to 0 or less will disable | 0 | | pwd_color_dirs | color of normal directories | 0087AF | | pwd_unwritable_icon | symbol to display when the current directory is not writable by the user | '' #Lock icon | diff --git a/conf.d/_tide_pwd.fish b/conf.d/_tide_pwd.fish index b633bb5..72f8b13 100644 --- a/conf.d/_tide_pwd.fish +++ b/conf.d/_tide_pwd.fish @@ -1,6 +1,6 @@ function _tide_pwd set -l truncatedPwd $_tide_pwd - set -g _tide_pwd_output $_tide_pwd + set -g _tide_pwd_output (set_color $tide_pwd_color_dirs)$_tide_pwd if not test -w $PWD set -p _tide_pwd_output (set_color $tide_pwd_color_dirs){$tide_pwd_unwritable_icon} diff --git a/conf.d/_tide_pwd_var_change.fish b/conf.d/_tide_pwd_var_change.fish index 1886097..622ac73 100644 --- a/conf.d/_tide_pwd_var_change.fish +++ b/conf.d/_tide_pwd_var_change.fish @@ -2,7 +2,7 @@ function _tide_pwd_var_change -v PWD set -l preDirNumberPwd (string replace $HOME '~' $PWD) set -l preDirNumberPwdSplit (string split --no-empty '/' $preDirNumberPwd) - set -g _tide_split_pwd $preDirNumberPwdSplit[(math -$tide_pwd_max_dirs)..-1] + set -g _tide_split_pwd $preDirNumberPwdSplit[(math -s0 -$tide_pwd_max_dirs)..-1] set -g _tide_pwd (string join '/' $_tide_split_pwd) set -g _tide_git_dir (git rev-parse --show-toplevel 2>/dev/null)