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 function _tide_item_jobs
if test $_tide_jobs_number != 0 test $_tide_jobs_number != 0 && if test "$tide_jobs_verbose" = true
if test "$tide_jobs_verbose" = true _tide_print_item jobs $tide_jobs_icon' ' $_tide_jobs_number
_tide_print_item jobs $tide_jobs_icon' ' $_tide_jobs_number else
else _tide_print_item jobs $tide_jobs_icon
_tide_print_item jobs $tide_jobs_icon
end
end 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 splitPwdForOutput[-1] $colorAnchors"$splitPwd[-1]"$keepBackgroundColor$colorDirs set splitPwdForOutput[-1] $colorAnchors"$splitPwd[-1]"$keepBackgroundColor$colorDirs
set -l pwdMaxLength (math $COLUMNS -$tide_pwd_truncate_margin) pwdMaxLength=(math $COLUMNS -$tide_pwd_truncate_margin) i=1 for dirSection in $splitPwd[2..-2]
set -l 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 -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 set i (math $i + 1) # This keeps us from using seq

View File

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

View File

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