aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2020-02-15 15:46:42 +0300
committerromkatv <roman.perepelitsa@gmail.com>2020-02-15 15:46:42 +0300
commit04e0cfa6703414ab9380ee3ac5430edf4e3bf1ba (patch)
tree09e658a59dff386dfa2cb55016e6f774e69e0808 /internal/p10k.zsh
parent245a42049914d1d7116bd0e0b26319cdc2832deb (diff)
add POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY; use PHP_ICON in php_version
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r--internal/p10k.zsh6
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 1e611ee8..6dc38561 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -2425,10 +2425,13 @@ instant_prompt_os_icon() { prompt_os_icon; }
################################################################
# Segment to display PHP version number
prompt_php_version() {
+ if (( _POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY )); then
+ _p9k_upglob 'composer.json|*.php' && return
+ fi
_p9k_cached_cmd_stdout php --version || return
[[ $_p9k__ret == (#b)(*$'\n')#(PHP [[:digit:].]##)* ]] || return
local v=$match[2]
- _p9k_prompt_segment "$0" "fuchsia" "grey93" '' 0 '' "${v//\%/%%}"
+ _p9k_prompt_segment "$0" "fuchsia" "grey93" 'PHP_ICON' 0 '' "${v//\%/%%}"
}
_p9k_prompt_php_version_init() {
@@ -6331,6 +6334,7 @@ _p9k_init_params() {
esac
_p9k_declare -b POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW 0
_p9k_declare -b POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY 0
+ _p9k_declare -b POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY 0
_p9k_declare -b POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY 1
_p9k_declare -b POWERLEVEL9K_GO_VERSION_PROJECT_ONLY 1
_p9k_declare -b POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY 1