Updated testing for folder icons

pull/22/head
Christo Kotze 7 years ago
parent 5cec4d652a
commit 9b7f8babe7

@ -727,8 +727,6 @@ prompt_dir() {
local current_path=$PWD # WAS: local current_path="$(print -P '%~')" local current_path=$PWD # WAS: local current_path="$(print -P '%~')"
# 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/"~"}
# save this path so that we can use the pure path for STATE icons and colors later.
local state_path=$current_path
# declare all local variables # declare all local variables
local paths directory test_dir test_dir_length trunc_path threshhold local paths directory test_dir test_dir_length trunc_path threshhold
# if we are not in "~" or "/", split the paths into an array and exclude "~" # if we are not in "~" or "/", split the paths into an array and exclude "~"
@ -891,12 +889,13 @@ prompt_dir() {
"HOME_SUBFOLDER" "HOME_SUB_ICON" "HOME_SUBFOLDER" "HOME_SUB_ICON"
"NOT_WRITABLE" "LOCK_ICON" "NOT_WRITABLE" "LOCK_ICON"
) )
local state_path="$(print -P '%~')"
local current_state="DEFAULT" local current_state="DEFAULT"
if [[ "${POWERLEVEL9K_DIR_SHOW_WRITABLE}" == true && ! -w "$PWD" ]]; then if [[ "${POWERLEVEL9K_DIR_SHOW_WRITABLE}" == true && ! -w "$PWD" ]]; then
current_state="NOT_WRITABLE" current_state="NOT_WRITABLE"
elif [[ "$state_path" == "$HOME" ]]; then # changed '~' to $HOME for compatibility with POWERLEVEL9K_DIR_PATH_ABSOLUTE elif [[ $state_path == '~' ]]; then
current_state="HOME" current_state="HOME"
elif [[ "$state_path" == "$HOME"* ]]; then # changed '~'* to $HOME* for compatibility with POWERLEVEL9K_DIR_PATH_ABSOLUTE elif [[ $state_path == '~'* ]]; then
current_state="HOME_SUBFOLDER" current_state="HOME_SUBFOLDER"
fi fi

Loading…
Cancel
Save