From 8c682d2abddd006398e9aed0a61212b4648b5a59 Mon Sep 17 00:00:00 2001 From: Michael Allen Date: Mon, 14 Sep 2015 17:22:01 +0100 Subject: Basic approach to format strings --- radar-base.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'radar-base.sh') diff --git a/radar-base.sh b/radar-base.sh index d9cd8f5..e21122a 100755 --- a/radar-base.sh +++ b/radar-base.sh @@ -65,6 +65,8 @@ prepare_zsh_colors() { COLOR_BRANCH="%{${GIT_RADAR_COLOR_BRANCH:-$reset_color}%}" MASTER_SYMBOL="${GIT_RADAR_MASTER_SYMBOL:-"%{$reset_color%}$italic_m%{$reset_color%}"}" + PROMPT_FORMAT="${GIT_RADAR_FORMAT:-""}" + RESET_COLOR_LOCAL="%{${GIT_RADAR_COLOR_LOCAL_RESET:-$reset_color}%}" RESET_COLOR_REMOTE="%{${GIT_RADAR_COLOR_REMOTE_RESET:-$reset_color}%}" RESET_COLOR_CHANGES="%{${GIT_RADAR_COLOR_CHANGES_RESET:-$reset_color}%}" @@ -484,3 +486,18 @@ show_remote_status() { fi return 0 } + +render_prompt() { + if [[ $PROMPT_FORMAT =~ ^.*%{remote}.*$ ]]; then + zsh_color_remote_commits + fi + if [[ $PROMPT_FORMAT =~ ^.*%{branch}.*$ ]]; then + zsh_readable_branch_name + fi + if [[ $PROMPT_FORMAT =~ ^.*%{local}.*$ ]]; then + zsh_color_local_commits + fi + if [[ $PROMPT_FORMAT =~ ^.*%{changes}.*$ ]]; then + zsh_color_changes_status + fi +} -- cgit v1.2.3