mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-19 05:51:57 +00:00
Get rid of unreadable BSU-pattern
Now the current folder in `truncate_with_folder_marker` strategy is truncated by cutting off the found folder from the beginning of $PWD.
This commit is contained in:
parent
a4cb875615
commit
f6c65e3cf7
1 changed files with 3 additions and 7 deletions
|
@ -615,7 +615,7 @@ prompt_dir() {
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
truncate_with_folder_marker)
|
truncate_with_folder_marker)
|
||||||
local last_marked_folder marked_folder zero
|
local last_marked_folder marked_folder
|
||||||
set_default POWERLEVEL9K_SHORTEN_FOLDER_MARKER ".shorten_folder_marker"
|
set_default POWERLEVEL9K_SHORTEN_FOLDER_MARKER ".shorten_folder_marker"
|
||||||
|
|
||||||
# Search for the folder marker in the parent directories and
|
# Search for the folder marker in the parent directories and
|
||||||
|
@ -637,12 +637,8 @@ prompt_dir() {
|
||||||
done
|
done
|
||||||
|
|
||||||
# Replace the shortest possible match of the marked folder from
|
# Replace the shortest possible match of the marked folder from
|
||||||
# the current path. Remove the amount of characters up to the
|
# the current path.
|
||||||
# folder marker from the left. Count only the visible characters
|
current_path=$current_path${PWD#${last_marked_folder}*}
|
||||||
# in the path (this is done by the "zero" pattern; see
|
|
||||||
# http://stackoverflow.com/a/40855342/5586433).
|
|
||||||
local zero='%([BSUbfksu]|([FB]|){*})'
|
|
||||||
current_path=$current_path${PWD:${#${(S%%)last_marked_folder//$~zero/}}}
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
current_path="%$((POWERLEVEL9K_SHORTEN_DIR_LENGTH+1))(c:$POWERLEVEL9K_SHORTEN_DELIMITER/:)%${POWERLEVEL9K_SHORTEN_DIR_LENGTH}c"
|
current_path="%$((POWERLEVEL9K_SHORTEN_DIR_LENGTH+1))(c:$POWERLEVEL9K_SHORTEN_DELIMITER/:)%${POWERLEVEL9K_SHORTEN_DIR_LENGTH}c"
|
||||||
|
|
Loading…
Reference in a new issue