mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-16 17:50:09 +00:00
add dir-writable indicator to the dir prompt key
This commit is contained in:
parent
77b319c0d3
commit
27a599e03e
1 changed files with 1 additions and 0 deletions
|
@ -885,6 +885,7 @@ prompt_dir() {
|
||||||
# using $PWD instead of "$(print -P '%~')" to allow use of POWERLEVEL9K_DIR_PATH_ABSOLUTE
|
# using $PWD instead of "$(print -P '%~')" to allow use of POWERLEVEL9K_DIR_PATH_ABSOLUTE
|
||||||
local current_path=$PWD # WAS: local current_path="$(print -P '%~')"
|
local current_path=$PWD # WAS: local current_path="$(print -P '%~')"
|
||||||
local cache_key="$0 $2 ${(q)current_path}"
|
local cache_key="$0 $2 ${(q)current_path}"
|
||||||
|
[[ "${POWERLEVEL9K_DIR_SHOW_WRITABLE}" == true && ! -w "$PWD" ]] && cache_key+=" W";
|
||||||
if ! p9k_cache_get $cache_key; then
|
if ! p9k_cache_get $cache_key; then
|
||||||
# check if the user wants to use absolute paths or "~" paths
|
# check if the user wants to use absolute paths or "~" paths
|
||||||
[[ ${(L)POWERLEVEL9K_DIR_PATH_ABSOLUTE} != "true" ]] && current_path=${current_path/#$HOME/"~"}
|
[[ ${(L)POWERLEVEL9K_DIR_PATH_ABSOLUTE} != "true" ]] && current_path=${current_path/#$HOME/"~"}
|
||||||
|
|
Loading…
Reference in a new issue