Minor edits

This commit is contained in:
Ilan Cosman 2021-05-04 20:26:58 -07:00
parent 06dc81c2bf
commit 56e80f1423
4 changed files with 10 additions and 21 deletions

View File

@ -1,9 +1,7 @@
function _tide_item_jobs
if test $_tide_jobs_number != 0
if test "$tide_jobs_verbose" = true
test $_tide_jobs_number != 0 && if test "$tide_jobs_verbose" = true
_tide_print_item jobs $tide_jobs_icon' ' $_tide_jobs_number
else
_tide_print_item jobs $tide_jobs_icon
end
end
end

View File

@ -11,10 +11,7 @@ function _tide_item_pwd
set splitPwdForOutput[1] $colorAnchors"$splitPwd[1]"$keepBackgroundColor$colorDirs
set splitPwdForOutput[-1] $colorAnchors"$splitPwd[-1]"$keepBackgroundColor$colorDirs
set -l pwdMaxLength (math $COLUMNS -$tide_pwd_truncate_margin)
set -l i 1
for dirSection in $splitPwd[2..-2]
pwdMaxLength=(math $COLUMNS -$tide_pwd_truncate_margin) i=1 for dirSection in $splitPwd[2..-2]
set -l parentDir (string join -- '/' $splitPwd[1..$i] | string replace '~' $HOME) # Use i from before increment
set i (math $i + 1) # This keeps us from using seq

View File

@ -1,10 +1,7 @@
function _tide_item_virtual_env
if set -l splitVirtualEnv (string split '/' "$VIRTUAL_ENV")
# Avoid printing a generic name
if contains -- $splitVirtualEnv[-1] virtualenv venv .venv env
set -l splitVirtualEnv (string split '/' "$VIRTUAL_ENV") && if contains -- $splitVirtualEnv[-1] virtualenv venv .venv env
_tide_print_item virtual_env $tide_virtual_env_icon' ' $splitVirtualEnv[-2]
else
_tide_print_item virtual_env $tide_virtual_env_icon' ' $splitVirtualEnv[-1]
end
end
end

View File

@ -4,10 +4,7 @@ function _tide_prompt
test "$tide_prompt_add_newline_before" = true && echo
set -l leftPrompt (_tide_left_prompt)
set -l rightPrompt (_tide_right_prompt)
if set -q leftPrompt[2] # If the prompt is two lines
leftPrompt=(_tide_left_prompt) rightPrompt=(_tide_right_prompt) if set -q leftPrompt[2] # If the prompt is two lines
set -l promptAndFrameColor (set_color $tide_prompt_frame_and_connection_color -b normal || echo)
if test "$tide_left_prompt_frame_enabled" = true