Merge pull request #1881 from NoahGorny/lint-pure-theme

Refactor scm_prompt usage in many themes
This commit is contained in:
Noah Gorny
2021-08-03 23:22:09 +03:00
committed by GitHub
16 changed files with 63 additions and 195 deletions

View File

@@ -121,6 +121,18 @@ function scm {
fi
}
scm_prompt() {
local CHAR=$(scm_char)
local format=${SCM_PROMPT_FORMAT:-'[%s%s]'}
if [[ $CHAR = "$SCM_NONE_CHAR" ]]; then
return
else
# shellcheck disable=2059
printf "$format\n" "$CHAR" "$(scm_prompt_info)"
fi
}
function scm_prompt_char {
if [[ -z $SCM ]]; then scm; fi
if [[ $SCM == "$SCM_GIT" ]]; then