From fc50e9d6c516e2d330463282051ec28bff6e6ccb Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Wed, 8 Jun 2016 01:17:19 -0700 Subject: [PATCH] Only show right prompt separator when date and cmd duration exist. See #48 --- fish_right_prompt.fish | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fish_right_prompt.fish b/fish_right_prompt.fish index f3ef14b..32f67da 100644 --- a/fish_right_prompt.fish +++ b/fish_right_prompt.fish @@ -5,22 +5,25 @@ function __bobthefish_cmd_duration -S -d 'Show command duration' [ "$CMD_DURATION" -lt 100 ]; and return if [ "$CMD_DURATION" -lt 5000 ] - echo -ns $CMD_DURATION 'ms ' + echo -ns $CMD_DURATION 'ms' else if [ "$CMD_DURATION" -lt 60000 ] math "scale=1;$CMD_DURATION/1000" | sed 's/\\.0$//' - echo -n 's ' + echo -n 's' else if [ "$CMD_DURATION" -lt 3600000 ] set_color $fish_color_error math "scale=1;$CMD_DURATION/60000" | sed 's/\\.0$//' - echo -n 'm ' + echo -n 'm' else set_color $fish_color_error math "scale=2;$CMD_DURATION/3600000" | sed 's/\\.0$//' - echo -n 'h ' + echo -n 'h' end set_color $fish_color_normal set_color $fish_color_autosuggestion + + [ "$theme_display_date" = "no" ] + or echo -ns ' ' $__bobthefish_left_arrow_glyph end function __bobthefish_timestamp -S -d 'Show the current timestamp' @@ -28,7 +31,6 @@ function __bobthefish_timestamp -S -d 'Show the current timestamp' set -q theme_date_format or set -l theme_date_format "+%c" - echo -n $__bobthefish_left_arrow_glyph echo -n ' ' date $theme_date_format end