From 7a13d046ab29ca5a4b803e827ac48fd082b3f63b Mon Sep 17 00:00:00 2001 From: ache Date: Sat, 19 Jan 2019 11:59:19 +0100 Subject: awk POSIX --- functions/fish_prompt.fish | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index b66528a..01968c9 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -1,4 +1,3 @@ - # Set these options in your config.fish (if you want to :]) # # set -g theme_display_user yes @@ -159,11 +158,13 @@ function git_status_summary -d "Deal with git status --porcelain" } { if (!after_first && $0 ~ /^##.+/) { - if ( match($0, /ahead ([1-9]+)/, a) ) { - ahead=a[1]; + if ( match($0, /ahead ([1-9]+)/) ) { + split(substr($0, RSTART, RLENGTH), A); + ahead=A[2]; } - if ( match($0, /behind ([1-9]+)/, a) ) { - behind=a[1]; + if ( match($0, /behind ([1-9]+)/) ) { + split(substr($0, RSTART, RLENGTH), A); + behind=A[2]; } } else if ($0 ~ /^\?\? .+/) { untracked += 1 -- cgit v1.2.3