Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

[Bugfix] Fix substring replacements used for trimming #1376

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions powerlevel9k.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ prompt_dir() {
# declare all local variables
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 "~"
(( ${#current_path} > 1 )) && paths=(${(s:/:)${current_path//"~\/"/}}) || paths=()
(( ${#current_path} > 1 )) && paths=(${(s:/:)${current_path/"~\/"/}}) || paths=()
# only run the code if SHORTEN_DIR_LENGTH is set, or we are using the two strategies that don't rely on it.
if [[ -n "$POWERLEVEL9K_SHORTEN_DIR_LENGTH" || "$POWERLEVEL9K_SHORTEN_STRATEGY" == "truncate_with_folder_marker" || "$POWERLEVEL9K_SHORTEN_STRATEGY" == "truncate_to_last" || "$POWERLEVEL9K_SHORTEN_STRATEGY" == "truncate_with_package_name" ]]; then
set_default POWERLEVEL9K_SHORTEN_DELIMITER "\u2026"
Expand Down Expand Up @@ -857,7 +857,7 @@ prompt_dir() {
# cheating here to retain ~ as home folder
local home_path="$(getUniqueFolder $HOME)"
trunc_path="$(getUniqueFolder $PWD)"
[[ $current_path == "~"* ]] && current_path="~${trunc_path//${home_path}/}" || current_path="/${trunc_path}"
[[ $current_path == "~"* ]] && current_path="~${trunc_path/${home_path}/}" || current_path="/${trunc_path}"
fi
;;
truncate_with_folder_marker)
Expand Down Expand Up @@ -1129,7 +1129,7 @@ prompt_laravel_version() {
local laravel_version="$(php artisan --version 2> /dev/null)"
if [[ -n "${laravel_version}" && "${laravel_version}" =~ "Laravel Framework" ]]; then
# Strip out everything but the version
laravel_version="${laravel_version//Laravel Framework /}"
laravel_version="${laravel_version/Laravel Framework /}"
"$1_prompt_segment" "$0" "$2" "maroon" "white" "${laravel_version}" 'LARAVEL_ICON'
fi
}
Expand Down