aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Perepelitsa <roman.perepelitsa@gmail.com>2021-05-22 12:32:24 +0300
committerRoman Perepelitsa <roman.perepelitsa@gmail.com>2021-05-22 12:32:24 +0300
commit4d2346da0ae352235bfafc7cc8774ce60da7e70b (patch)
treea69504d0b89d2cbc5414de1af1f4c5f99154ad56
parent0ab7e1ccfd91ecdc3a3ad2efcc8704d589d1ff54 (diff)
set P9K_PYENV_PYTHON_VERSION correctly when dealing with multiple pyenv versions (#1376)
-rw-r--r--internal/p10k.zsh14
1 files changed, 9 insertions, 5 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 69195505..0d4db86a 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -4216,11 +4216,15 @@ function _p9k_pyenv_compute() {
local versions=${PYENV_ROOT:-$HOME/.pyenv}/versions
versions=${versions:A}
- local version=$versions/$v
- version=${version:A}
- if [[ $version == (#b)$versions/([^/]##)* ]]; then
- typeset -g P9K_PYENV_PYTHON_VERSION=$match[1]
- fi
+ local name version
+ for name in ${(s.:.)v}; do
+ version=$versions/$name
+ version=${version:A}
+ if [[ $version(#qN/) == (#b)$versions/([^/]##)* ]]; then
+ typeset -g P9K_PYENV_PYTHON_VERSION=$match[1]
+ break
+ fi
+ done
typeset -g _p9k__pyenv_version=$v
}