From ce7b99cdaf4459afb7d7043cae25e4f02489ba87 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Tue, 17 Nov 2015 01:39:49 +0100 Subject: Added a mechanism to make deprecated segments visible to the user. --- powerlevel9k.zsh-theme | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'powerlevel9k.zsh-theme') diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 0707276d..7f3af8a7 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -754,6 +754,14 @@ powerlevel9k_init() { print -P "You should put: %F{blue}export TERM=\"xterm-256color\"%f in your \~\/.zshrc" fi + typeset -Ah deprecated_segments + # old => new + deprecated_segments=( + 'longstatus' 'status' + ) + print_deprecation_warning deprecated_segments + + setopt prompt_subst setopt LOCAL_OPTIONS -- cgit v1.2.3 From f9957ca5592df0ab992d3750e18ee6f61b3e3002 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Tue, 17 Nov 2015 18:34:18 +0100 Subject: Used typeset to define the local array. This does the trick on linux. --- functions/utilities.zsh | 3 ++- powerlevel9k.zsh-theme | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'powerlevel9k.zsh-theme') diff --git a/functions/utilities.zsh b/functions/utilities.zsh index 3c6a4d49..f855caf5 100644 --- a/functions/utilities.zsh +++ b/functions/utilities.zsh @@ -124,7 +124,8 @@ fi # deprecated segments as keys, the values contain the new # segment names. print_deprecation_warning() { - local -A raw_deprecated_segments=(${(kvP)1}) + typeset -AH raw_deprecated_segments + raw_deprecated_segments=(${(kvP@)1}) for key in ${(@k)raw_deprecated_segments}; do if [[ -n "${POWERLEVEL9K_LEFT_PROMPT_ELEMENTS[(r)$key]}" ]] || [[ -n "${POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[(r)$key]}" ]]; then diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 7f3af8a7..cdcb9a96 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -754,14 +754,14 @@ powerlevel9k_init() { print -P "You should put: %F{blue}export TERM=\"xterm-256color\"%f in your \~\/.zshrc" fi - typeset -Ah deprecated_segments + # Display a warning if deprecated segments are in use. + typeset -AH deprecated_segments # old => new deprecated_segments=( 'longstatus' 'status' ) print_deprecation_warning deprecated_segments - setopt prompt_subst setopt LOCAL_OPTIONS -- cgit v1.2.3