mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-13 16:40:08 +00:00
speed up swift_version prompt
This commit is contained in:
parent
4a3b62cde9
commit
5b703c0db0
1 changed files with 4 additions and 5 deletions
|
@ -2039,11 +2039,10 @@ prompt_openfoam() {
|
||||||
################################################################
|
################################################################
|
||||||
# Segment to display Swift version
|
# Segment to display Swift version
|
||||||
prompt_swift_version() {
|
prompt_swift_version() {
|
||||||
# Get the first number as this is probably the "main" version number..
|
_p9k_cached_cmd_stdout swift --version || return
|
||||||
local swift_version=$(swift --version 2>/dev/null | grep -o -E "[0-9.]+" | head -n 1)
|
emulate -L zsh && setopt extendedglob
|
||||||
[[ -z "${swift_version}" ]] && return
|
[[ $_P9K_RETVAL == (#b)[^[:digit:]]#([[:digit:].]##)* ]] || return
|
||||||
|
"$1_prompt_segment" "$0" "$2" "magenta" "white" 'SWIFT_ICON' 0 '' "${match[1]//\%/%%}"
|
||||||
"$1_prompt_segment" "$0" "$2" "magenta" "white" 'SWIFT_ICON' 0 '' "${swift_version//\%/%%}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
|
|
Loading…
Reference in a new issue