aboutsummaryrefslogtreecommitdiff
path: root/internal/wizard.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2020-02-27 13:57:17 +0300
committerromkatv <roman.perepelitsa@gmail.com>2020-02-27 13:57:17 +0300
commit91023a1d8ac8f1e4ea323bad9168b15e2115a8fe (patch)
tree42fb369a7da9df34542076f54bfb4084f1368c02 /internal/wizard.zsh
parent0f406f088d24c5c0588705284ef8cdcce16820bd (diff)
wizard: if cannot display powerline glyphs, use flat heads by default and offer to change to blurred
Diffstat (limited to 'internal/wizard.zsh')
-rwxr-xr-xinternal/wizard.zsh46
1 files changed, 35 insertions, 11 deletions
diff --git a/internal/wizard.zsh b/internal/wizard.zsh
index 04b258fc..722bc20f 100755
--- a/internal/wizard.zsh
+++ b/internal/wizard.zsh
@@ -1102,7 +1102,7 @@ function ask_separators() {
}
function ask_heads() {
- if [[ $style != (classic|rainbow) || $cap_diamond != 1 ]]; then
+ if [[ $style != (classic|rainbow) ]]; then
return 0
fi
if [[ $POWERLEVEL9K_MODE == nerdfont-complete && $LINES -lt 26 ]]; then
@@ -1113,15 +1113,23 @@ function ask_heads() {
while true; do
local extra=
clear
+ if
flowing -c "%BPrompt Heads%b"
- if [[ -n $nl ]]; then
- print -P " head"
- print -P "%B(1) Sharp.%b |"
- print -P " v"
+ if (( cap_diamond )); then
+ if [[ -n $nl ]]; then
+ print -P " head"
+ print -P "%B(1) Sharp.%b |"
+ print -P " v"
+ else
+ print -P "%B(1) Sharp.%b"
+ fi
+ left_head=$right_triangle right_head=$left_triangle print_prompt
else
- print -P "%B(1) Sharp.%b"
+ print -P ""
+ print -P "%B(1) Flat.%b"
+ print -P ""
+ left_head= right_head= print_prompt
fi
- left_head=$right_triangle right_head=$left_triangle print_prompt
print -P ""
print -P "%B(2) Blurred.%b"
print -n $nl
@@ -1148,8 +1156,24 @@ function ask_heads() {
case $key in
q) quit;;
r) return 1;;
- 1) left_head=$right_triangle; right_head=$left_triangle; options+='sharp heads'; break;;
- 2) left_head=$fade_out; right_head=$fade_in; options+='blurred heads'; break;;
+ 1)
+ if (( cap_diamond )); then
+ left_head=$right_triangle
+ right_head=$left_triangle
+ options+='sharp heads'
+ else
+ left_head=
+ right_head=
+ options+='flat heads'
+ fi
+ break
+ ;;
+ 2)
+ left_head=$fade_out
+ right_head=$fade_in
+ options+='blurred heads'
+ break
+ ;;
3)
if [[ $extra == *3* ]]; then
left_head=$down_triangle
@@ -1971,8 +1995,8 @@ while true; do
right_sep=
left_subsep=$vertical_bar
right_subsep=$vertical_bar
- left_head=$fade_out
- right_head=$fade_in
+ left_head=
+ right_head=
fi
_p9k_init_icons
ask_narrow_icons || continue