1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-26 00:41:57 +00:00

bug fix: escape backquote; fixes #404

This commit is contained in:
romkatv 2020-01-01 18:07:40 +01:00
parent 8baa6d3a35
commit f220106baa

View file

@ -468,7 +468,7 @@ _p9k_escape_style() {
} }
_p9k_escape() { _p9k_escape() {
[[ $1 == *["~!#\$^&*()\\\"'<>?{}[]"]* ]] && _p9k_ret="\${(Q)\${:-${(qqq)${(q)1}}}}" || _p9k_ret=$1 [[ $1 == *["~!#\`\$^&*()\\\"'<>?{}[]"]* ]] && _p9k_ret="\${(Q)\${:-${(qqq)${(q)1}}}}" || _p9k_ret=$1
} }
# * $1: Name of the function that was originally invoked. # * $1: Name of the function that was originally invoked.
@ -1496,7 +1496,7 @@ prompt_dir() {
if [[ $pair == ${mtime:-x}:* ]]; then if [[ $pair == ${mtime:-x}:* ]]; then
parts[i]=${pair#*:} parts[i]=${pair#*:}
else else
[[ $sub != *["~!#\$^&*()\\\"'<>?{}[]"]* ]] [[ $sub != *["~!#\`\$^&*()\\\"'<>?{}[]"]* ]]
local -i q=$? local -i q=$?
if [[ -n $_POWERLEVEL9K_SHORTEN_FOLDER_MARKER && if [[ -n $_POWERLEVEL9K_SHORTEN_FOLDER_MARKER &&
-n $parent/$sub/${~_POWERLEVEL9K_SHORTEN_FOLDER_MARKER}(#qN) ]]; then -n $parent/$sub/${~_POWERLEVEL9K_SHORTEN_FOLDER_MARKER}(#qN) ]]; then
@ -1525,7 +1525,7 @@ prompt_dir() {
parent+=/$sub parent+=/$sub
done done
for ((; i <= $#parts; ++i)); do for ((; i <= $#parts; ++i)); do
[[ $parts[i] == *["~!#\$^&*()\\\"'<>?{}[]"]* ]] && parts[i]='${(Q)${:-'${(qqq)${(q)parts[i]}}'}}' [[ $parts[i] == *["~!#\`\$^&*()\\\"'<>?{}[]"]* ]] && parts[i]='${(Q)${:-'${(qqq)${(q)parts[i]}}'}}'
parts[i]+=$'\2' parts[i]+=$'\2'
done done
[[ -n $key ]] && _p9k_cache_ephemeral_set "$key" "${parts[@]}" [[ -n $key ]] && _p9k_cache_ephemeral_set "$key" "${parts[@]}"
@ -5473,7 +5473,7 @@ _p9k_must_init() {
[[ $sig == $_p9k__param_sig ]] && return 1 [[ $sig == $_p9k__param_sig ]] && return 1
_p9k_deinit _p9k_deinit
fi fi
_p9k__param_pat=$'v16\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' _p9k__param_pat=$'v17\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1'
_p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1'
_p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1'
_p9k__param_pat+=$'$DEFAULT_USER\1${ZLE_RPROMPT_INDENT:-1}\1$P9K_SSH\1$__p9k_ksh_arrays' _p9k__param_pat+=$'$DEFAULT_USER\1${ZLE_RPROMPT_INDENT:-1}\1$P9K_SSH\1$__p9k_ksh_arrays'