aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-07-31 19:35:37 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-07-31 19:35:37 +0300
commit6d11cb5f5da00ce00291941bcf2706997db2c1fb (patch)
tree0fbc9faaff661df8f9973d2e0e44246283757bde
parenta6b572da4597626fb55b11abb9d3fb0dc255a5cd (diff)
format options better
-rwxr-xr-xinternal/wizard.zsh25
1 files changed, 18 insertions, 7 deletions
diff --git a/internal/wizard.zsh b/internal/wizard.zsh
index 066be483..b528f5f4 100755
--- a/internal/wizard.zsh
+++ b/internal/wizard.zsh
@@ -277,7 +277,7 @@ function ask_narrow_icons() {
q) quit;;
r) return 1;;
y) cap_narrow_icons=1; options+='small icons'; break;;
- n) cap_narrow_icons=0; break;;
+ n) cap_narrow_icons=0; options+='large icons'; break;;
esac
done
}
@@ -417,7 +417,7 @@ function ask_prefixes() {
case $key in
q) quit;;
r) return 1;;
- 1) prefixes=('' ''); break;;
+ 1) prefixes=('' ''); options+=concise; break;;
2) prefixes=("$fluent[@]"); options+=fluent; break;;
esac
done
@@ -461,7 +461,7 @@ function ask_separators() {
right_sep=$left_triangle
left_subsep=$right_angle
right_subsep=$left_angle
- options+='angled sep'
+ options+='angled separators'
break
;;
2)
@@ -469,7 +469,7 @@ function ask_separators() {
right_sep=''
left_subsep=$vertical_bar
right_subsep=$vertical_bar
- options+='vertical sep'
+ options+='vertical separators'
break
;;
3)
@@ -478,7 +478,7 @@ function ask_separators() {
right_sep=$up_triangle
left_subsep=$slanted_bar
right_subsep=$slanted_bar
- options+='slanted sep'
+ options+='slanted separators'
break
fi
;;
@@ -910,8 +910,19 @@ function generate_config() {
fi
fi
header+=$'.\n'
- header+="# Wizard options: ${(j:, :)options}"
- header+=$'.\n#'
+ local line="# Wizard options: $options[1]"
+ local opt
+ for opt in $options[2,-1]; do
+ if (( $#line + $#opt > 85 )); then
+ header+=$line
+ header+=$',\n'
+ line="# $opt"
+ else
+ line+=", $opt"
+ fi
+ done
+ header+=$line
+ header+=$'.\n# Type `p10k configure` to generate another config.\n#'
if [[ -e $__p9k_cfg_path ]]; then
unlink $__p9k_cfg_path || return 1