1
0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-12 19:18:28 +02:00

Multiline-Icons should be treated as icons as well.

This commit is contained in:
Dominik Ritter 2015-08-04 18:56:00 +02:00
parent 5777b7bb54
commit b1dba08c93

View File

@ -58,70 +58,74 @@ case $POWERLEVEL9K_MODE in
# Awesome-Patched Font required! # Awesome-Patched Font required!
# See https://github.com/gabrielelana/awesome-terminal-fonts/tree/patching-strategy/patched # See https://github.com/gabrielelana/awesome-terminal-fonts/tree/patching-strategy/patched
icons=( icons=(
LEFT_SEGMENT_SEPARATOR "\UE0B0" #  LEFT_SEGMENT_SEPARATOR "\UE0B0" # 
RIGHT_SEGMENT_SEPARATOR "\UE0B2" #  RIGHT_SEGMENT_SEPARATOR "\UE0B2" # 
ROOT_ICON "\UE801" #  ROOT_ICON "\UE801" # 
RUBY_ICON "\UE847" #  RUBY_ICON "\UE847" # 
AWS_ICON "\UE895" #  AWS_ICON "\UE895" # 
BACKGROUND_JOBS_ICON "\UE82F " #  BACKGROUND_JOBS_ICON "\UE82F " # 
TEST_ICON "\UE891" #  TEST_ICON "\UE891" # 
OK_ICON "\U2713" # ✓ OK_ICON "\U2713" # ✓
FAIL_ICON "\U2718" # ✘ FAIL_ICON "\U2718" # ✘
SYMFONY_ICON "SF" SYMFONY_ICON "SF"
APPLE_ICON $'\UF8FF' #  MULTILINE_FIRST_PROMPT_PREFIX "╭─"
FREEBSD_ICON $'\U1F608 ' # 😈 MULTILINE_SECOND_PROMPT_PREFIX "╰─ "
LINUX_ICON $'\U1F427 ' # 🐧 APPLE_ICON $'\UF8FF' # 
SUNOS_ICON $'\U1F31E ' # 🌞 FREEBSD_ICON $'\U1F608 ' # 😈
VCS_UNTRACKED_ICON "\UE16C" #  LINUX_ICON $'\U1F427 ' # 🐧
VCS_UNSTAGED_ICON "\UE17C" #  SUNOS_ICON $'\U1F31E ' # 🌞
VCS_STAGED_ICON "\UE168" #  VCS_UNTRACKED_ICON "\UE16C" # 
VCS_STASH_ICON "\UE133 " #  VCS_UNSTAGED_ICON "\UE17C" # 
#VCS_INCOMING_CHANGES "\UE1EB " #  VCS_STAGED_ICON "\UE168" # 
#VCS_INCOMING_CHANGES "\UE80D " #  VCS_STASH_ICON "\UE133 " # 
VCS_INCOMING_CHANGES "\UE131 " #  #VCS_INCOMING_CHANGES "\UE1EB " # 
#VCS_OUTGOING_CHANGES "\UE1EC " #  #VCS_INCOMING_CHANGES "\UE80D " # 
#VCS_OUTGOING_CHANGES "\UE80E " #  VCS_INCOMING_CHANGES "\UE131 " # 
VCS_OUTGOING_CHANGES "\UE132 " #  #VCS_OUTGOING_CHANGES "\UE1EC " # 
VCS_TAG_ICON "\UE817 " #  #VCS_OUTGOING_CHANGES "\UE80E " # 
VCS_BOOKMARK_ICON "\UE87B" #  VCS_OUTGOING_CHANGES "\UE132 " # 
VCS_COMMIT_ICON "\UE821 " #  VCS_TAG_ICON "\UE817 " # 
VCS_BRANCH_ICON $'\UE220' #  VCS_BOOKMARK_ICON "\UE87B" # 
VCS_REMOTE_BRANCH_ICON " \UE804 " #  VCS_COMMIT_ICON "\UE821 " # 
VCS_GIT_ICON "\UE20E " #  VCS_BRANCH_ICON $'\UE220' # 
VCS_HG_ICON "\UE1C3 " #  VCS_REMOTE_BRANCH_ICON " \UE804 " # 
VCS_GIT_ICON "\UE20E " # 
VCS_HG_ICON "\UE1C3 " # 
) )
;; ;;
*) *)
# Powerline-Patched Font required! # Powerline-Patched Font required!
# See https://github.com/Lokaltog/powerline-fonts # See https://github.com/Lokaltog/powerline-fonts
icons=( icons=(
LEFT_SEGMENT_SEPARATOR "\UE0B0" #  LEFT_SEGMENT_SEPARATOR "\UE0B0" # 
RIGHT_SEGMENT_SEPARATOR "\UE0B2" #  RIGHT_SEGMENT_SEPARATOR "\UE0B2" # 
ROOT_ICON "\U26A1" # ⚡ ROOT_ICON "\U26A1" # ⚡
RUBY_ICON '' RUBY_ICON ''
AWS_ICON "AWS:" AWS_ICON "AWS:"
BACKGROUND_JOBS_ICON "\U2699" # ⚙ BACKGROUND_JOBS_ICON "\U2699" # ⚙
TEST_ICON '' TEST_ICON ''
OK_ICON "\U2713" # ✓ OK_ICON "\U2713" # ✓
FAIL_ICON "\U2718" # ✘ FAIL_ICON "\U2718" # ✘
SYMFONY_ICON "SF" SYMFONY_ICON "SF"
APPLE_ICON 'OSX' MULTILINE_FIRST_PROMPT_PREFIX "╭─"
FREEBSD_ICON 'BSD' MULTILINE_SECOND_PROMPT_PREFIX "╰─ "
LINUX_ICON 'Lx' APPLE_ICON 'OSX'
SUNOS_ICON 'Sun' FREEBSD_ICON 'BSD'
VCS_UNTRACKED_ICON '?' LINUX_ICON 'Lx'
VCS_UNSTAGED_ICON "\U25CF" # ● SUNOS_ICON 'Sun'
VCS_STAGED_ICON "\U271A" # ✚ VCS_UNTRACKED_ICON '?'
VCS_STASH_ICON "\U235F" # ⍟ VCS_UNSTAGED_ICON "\U25CF" # ●
VCS_INCOMING_CHANGES "\U2193" # ↓ VCS_STAGED_ICON "\U271A" # ✚
VCS_OUTGOING_CHANGES "\U2191" # ↑ VCS_STASH_ICON "\U235F" # ⍟
VCS_TAG_ICON '' VCS_INCOMING_CHANGES "\U2193" # ↓
VCS_BOOKMARK_ICON "\U263F" # ☿ VCS_OUTGOING_CHANGES "\U2191" # ↑
VCS_COMMIT_ICON '' VCS_TAG_ICON ''
VCS_BRANCH_ICON "\UE0A0 " #  VCS_BOOKMARK_ICON "\U263F" # ☿
VCS_REMOTE_BRANCH_ICON "\U2192" # → VCS_COMMIT_ICON ''
VCS_GIT_ICON "" VCS_BRANCH_ICON "\UE0A0 " # 
VCS_HG_ICON "" VCS_REMOTE_BRANCH_ICON "\U2192" # →
VCS_GIT_ICON ""
VCS_HG_ICON ""
) )
;; ;;
esac esac
@ -140,7 +144,7 @@ case $POWERLEVEL9K_MODE in
esac esac
if [[ "$POWERLEVEL9K_HIDE_BRANCH_ICON" == true ]]; then if [[ "$POWERLEVEL9K_HIDE_BRANCH_ICON" == true ]]; then
$icons['VCS_BRANCH_ICON']='' icons[VCS_BRANCH_ICON]=''
fi fi
function print_icon() { function print_icon() {
@ -643,11 +647,8 @@ powerlevel9k_init() {
add-zsh-hook precmd vcs_info add-zsh-hook precmd vcs_info
if [[ "$POWERLEVEL9K_PROMPT_ON_NEWLINE" == true ]]; then if [[ "$POWERLEVEL9K_PROMPT_ON_NEWLINE" == true ]]; then
[[ -n $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX ]] || POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="╭─" PROMPT="$(print_icon 'MULTILINE_FIRST_PROMPT_PREFIX')%{%f%b%k%}"'$(build_left_prompt)'"
[[ -n $POWERLEVEL9K_MULTILINE_SECOND_PROMPT_PREFIX ]] || POWERLEVEL9K_MULTILINE_SECOND_PROMPT_PREFIX="╰─ " $(print_icon 'MULTILINE_SECOND_PROMPT_PREFIX')"
PROMPT="$POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX%{%f%b%k%}"'$(build_left_prompt)'"
$POWERLEVEL9K_MULTILINE_SECOND_PROMPT_PREFIX"
# The right prompt should be on the same line as the first line of the left # The right prompt should be on the same line as the first line of the left
# prompt. To do so, there is just a quite ugly workaround: Before zsh draws # prompt. To do so, there is just a quite ugly workaround: Before zsh draws
# the RPROMPT, we advise it, to go one line up. At the end of RPROMPT, we # the RPROMPT, we advise it, to go one line up. At the end of RPROMPT, we