From acddd005faa6ddeace298b1a5cade4f6ae27f281 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sat, 11 Jul 2015 18:59:46 +0100 Subject: [PATCH] zsh: fix git prompt --- zsh/lib/prompt.zsh | 6 +++--- zshrc | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/zsh/lib/prompt.zsh b/zsh/lib/prompt.zsh index 61f5db8..3fc1c24 100644 --- a/zsh/lib/prompt.zsh +++ b/zsh/lib/prompt.zsh @@ -41,9 +41,9 @@ git_prompt_status() { # Get current status. while IFS=$'\n' read line; do if [[ "$line" == \#\#\ * ]]; then - [[ "$line" =~ '## ([^.]*)\.\.\.(.*)' ]] && branch=$match[1] - [[ "$line" =~ 'ahead ([0-9]+)' ]] && ahead=$match[1] - [[ "$line" =~ 'behind ([0-9]+)' ]] && behind=$match[1] + [[ "$line" =~ '## (.*?)(\.\.\.|$)' ]] && branch=$match[1] + [[ "$line" =~ 'ahead ([0-9]+)' ]] && ahead=$match[1] + [[ "$line" =~ 'behind ([0-9]+)' ]] && behind=$match[1] else # Count added, deleted, modified, renamed, unmerged, untracked, dirty. # T (type change) is undocumented, see http://git.io/FnpMGw. diff --git a/zshrc b/zshrc index e6126f2..aad02d3 100644 --- a/zshrc +++ b/zshrc @@ -30,6 +30,7 @@ setopt noclobber # don't allow overwriting files with '>', use '>!' instead setopt notify setopt rcquotes # echo 'don''t'; prints don't setopt dvorak # correct_all uses dvorak +setopt rematch_pcre # use perl regexp # disable flow control setopt noflowcontrol -- 2.48.1