From 6e67ade8f31b3ebc4df54fbfb36b7213f8e407b3 Mon Sep 17 00:00:00 2001 From: Chris Baker Date: Tue, 12 Mar 2019 16:08:00 -0400 Subject: [PATCH 1/3] remove reference to POWERLEVEL9K_RBENV_ALWAYS --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index b4e5fb2c8..d513fbb28 100644 --- a/README.md +++ b/README.md @@ -573,10 +573,6 @@ It figures out the version being used by taking the output of the `rbenv version * If `rbenv` is not in $PATH, nothing will be shown. * By default, if the current local Ruby version is the same as the global Ruby version, nothing will be shown. See the configuration variable, below, to modify this behavior. -Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_RBENV_ALWAYS`|'false'|Always show the `rbenv` segment, even if the local version matches the global.| - | Variable | Default Value | Description | |----------|---------------|-------------| |`POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW`|`false`|Set to true if you wish to show the rbenv segment even if the current Ruby version is the same as the global Ruby version| From 690af685ef939307a6dd944c00ece0ae90fc0367 Mon Sep 17 00:00:00 2001 From: matt1003 Date: Mon, 25 Mar 2019 17:17:04 +1300 Subject: [PATCH 2/3] Ensure VCS is enabled when using segment "vcs_joined" fixes: https://github.com/bhilburn/powerlevel9k/issues/1116 --- powerlevel9k.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 4939cb354..9693dd8c1 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -1910,7 +1910,7 @@ prompt_powerlevel9k_setup() { # initialize colors autoload -U colors && colors - if segment_in_use "vcs"; then + if segment_in_use "vcs" || segment_in_use "vcs_joined"; then powerlevel9k_vcs_init fi From 1015b38cf2b32c1f9d2236fdcbc59c3bc6697d33 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Sat, 30 Mar 2019 00:05:33 +0100 Subject: [PATCH 3/3] Make check for segments in use take joined segments into account --- functions/utilities.zsh | 9 ++++----- powerlevel9k.zsh-theme | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/functions/utilities.zsh b/functions/utilities.zsh index 8c18bb44d..388eb0e1c 100755 --- a/functions/utilities.zsh +++ b/functions/utilities.zsh @@ -202,11 +202,10 @@ fi # * $1: The segment to be tested. segment_in_use() { local key=$1 - if [[ -n "${POWERLEVEL9K_LEFT_PROMPT_ELEMENTS[(r)$key]}" ]] || [[ -n "${POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[(r)$key]}" ]]; then - return 0 - else - return 1 - fi + [[ -n "${POWERLEVEL9K_LEFT_PROMPT_ELEMENTS[(r)${key}]}" || + -n "${POWERLEVEL9K_LEFT_PROMPT_ELEMENTS[(r)${key}_joined]}" || + -n "${POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[(r)${key}]}" || + -n "${POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[(r)${key}_joined]}" ]] } # Print a deprecation warning if an old segment is in use. diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 9693dd8c1..4939cb354 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -1910,7 +1910,7 @@ prompt_powerlevel9k_setup() { # initialize colors autoload -U colors && colors - if segment_in_use "vcs" || segment_in_use "vcs_joined"; then + if segment_in_use "vcs"; then powerlevel9k_vcs_init fi