mirror of
https://github.com/IlanCosman/tide.git
synced 2024-11-22 23:03:26 +03:00
minor edits
This commit is contained in:
parent
416c2d704a
commit
d06f92e65f
@ -1,12 +1,12 @@
|
||||
function _tide_cache_variables
|
||||
# pwd
|
||||
set_color -o $tide_pwd_color_anchors | read -gx _tide_color_anchors
|
||||
set -gx _tide_color_truncated_dirs (set_color $tide_pwd_color_truncated_dirs || echo)
|
||||
set -gx _tide_color_truncated_dirs "$(set_color $tide_pwd_color_truncated_dirs)"
|
||||
set -gx _tide_reset_to_color_dirs (set_color normal -b $tide_pwd_bg_color; set_color $tide_pwd_color_dirs)
|
||||
|
||||
# git
|
||||
contains git $tide_left_prompt_items $tide_right_prompt_items &&
|
||||
set -gx _tide_location_color (set_color $tide_git_color_branch || echo)
|
||||
set -gx _tide_location_color "$(set_color $tide_git_color_branch)"
|
||||
|
||||
# two line prompt
|
||||
if contains newline $tide_left_prompt_items
|
||||
|
@ -19,20 +19,20 @@ function _tide_prompt
|
||||
|
||||
if set -q _tide_prompt_and_frame_color # If prompt is two lines
|
||||
if test "$tide_left_prompt_frame_enabled" = true
|
||||
set left_prompt[1] $_tide_prompt_and_frame_color╭─"$left_prompt[1]"
|
||||
set left_prompt[2] $_tide_prompt_and_frame_color╰─"$left_prompt[2]"
|
||||
set left_prompt[1] "$_tide_prompt_and_frame_color╭─$left_prompt[1]"
|
||||
set left_prompt[2] "$_tide_prompt_and_frame_color╰─$left_prompt[2]"
|
||||
end
|
||||
if test "$tide_right_prompt_frame_enabled" = true
|
||||
set right_prompt[1] "$right_prompt[1]"$_tide_prompt_and_frame_color─╮
|
||||
set right_prompt[2] "$right_prompt[2]"$_tide_prompt_and_frame_color─╯
|
||||
set right_prompt[1] "$right_prompt[1]$_tide_prompt_and_frame_color─╮"
|
||||
set right_prompt[2] "$right_prompt[2]$_tide_prompt_and_frame_color─╯"
|
||||
end
|
||||
|
||||
# 5 = @PWD@ length which will be replaced
|
||||
math $COLUMNS+5-(string length --visible "$left_prompt[1]$right_prompt[1]") | read -lx dist_btwn_sides
|
||||
echo -ns $right_prompt[2] \n (string replace @PWD@ (_tide_pwd) "$left_prompt[1]") $_tide_prompt_and_frame_color
|
||||
echo -ns "$right_prompt[2]"\n(string replace @PWD@ (_tide_pwd) "$left_prompt[1]")$_tide_prompt_and_frame_color
|
||||
|
||||
string repeat --no-newline --max (math max 0, $dist_btwn_sides-$pwd_length) $tide_prompt_icon_connection
|
||||
echo -ns $right_prompt[1] \n $left_prompt[2]' '
|
||||
echo -ns "$right_prompt[1]"\n"$left_prompt[2] "
|
||||
else
|
||||
math $COLUMNS+5-(string length --visible "$left_prompt[1]$right_prompt[1]") -$tide_prompt_min_cols | read -lx dist_btwn_sides
|
||||
string replace @PWD@ (_tide_pwd) "$right_prompt[1]" "$left_prompt[1] "
|
||||
|
@ -25,7 +25,7 @@ function _tide_pwd
|
||||
math $i+1 | read i
|
||||
|
||||
# Returns true if any markers exist in dir_section
|
||||
if test -z false (string split --max 2 " " -- "-o -e "$parent_dir/$dir_section/$tide_pwd_markers)
|
||||
if test -z false (string split --max 2 " " -- "-o -e $parent_dir/$dir_section/"$tide_pwd_markers)
|
||||
set split_pwd_for_output[$i] $_tide_color_anchors$dir_section$_tide_reset_to_color_dirs
|
||||
else if test $pwd_length -gt $dist_btwn_sides
|
||||
while set -l truncation_length (math $truncation_length +1) &&
|
||||
|
Loading…
Reference in New Issue
Block a user