Combine left frame, right frame, and connection colors

This commit is contained in:
Ilan Cosman 2021-05-04 15:17:19 -07:00
parent 73c7dc2c25
commit 493e81eee0
8 changed files with 41 additions and 75 deletions

View File

@ -9,20 +9,19 @@ function _tide_prompt
set -l rightPrompt (_tide_right_prompt)
if test $leftPromptHeight = 2
set -l promptAndFrameColor (set_color $tide_prompt_frame_and_connection_color -b normal || echo)
if test "$tide_left_prompt_frame_enabled" = true
set -l frameColor (set_color $tide_left_prompt_frame_color -b normal || echo)
set leftPrompt[1] $frameColor╭─"$leftPrompt[1]"
set leftPrompt[2] $frameColor╰─"$leftPrompt[2]"
set leftPrompt[1] $promptAndFrameColor╭─"$leftPrompt[1]"
set leftPrompt[2] $promptAndFrameColor╰─"$leftPrompt[2]"
end
if test "$tide_right_prompt_frame_enabled" = true
set -l frameColor (set_color $tide_right_prompt_frame_color -b normal || echo)
set rightPrompt[1] "$rightPrompt[1]"$frameColor─╮
set rightPrompt[2] "$rightPrompt[2]"$frameColor─╯
set rightPrompt[1] "$rightPrompt[1]"$promptAndFrameColor─╮
set rightPrompt[2] "$rightPrompt[2]"$promptAndFrameColor─╯
end
printf '%s' $leftPrompt[1]
printf '%s' $leftPrompt[1] $promptAndFrameColor
set_color $tide_prompt_connection_color
set -l lengthToMove (math $COLUMNS - (_tide_decolor "$leftPrompt[1]""$rightPrompt[1]" | string length))
test $lengthToMove -gt 0 && string repeat --no-newline --max $lengthToMove $tide_prompt_connection_icon

View File

@ -1,57 +1,36 @@
function prompt_connection_andor_frame_color
if test "$_tide_16color" = true
if test "$_tide_16color" = true ||
test "$fake_tide_left_prompt_frame_enabled" = false -a \
"$fake_tide_right_prompt_frame_enabled" = false -a \
"$fake_tide_prompt_connection_icon" = ' '
_next_choice all/prompt_spacing
return 0
end
test -n "$fake_tide_prompt_connection_icon" && set promptConnectionExists
test "$fake_tide_left_prompt_frame_enabled" = true -o "$fake_tide_right_prompt_frame_enabled" = true && set frameExists
if set -q promptConnectionExists && set -q frameExists
set title "Connection & Frame Color"
else if set -q promptConnectionExists
set title "Connection Color"
else if set -q frameExists
set title "Frame Color"
else
_next_choice all/prompt_spacing
return 0
end
_tide_title $title
_tide_title "Connection & Frame Color"
_tide_option 1 Lightest
_set_prompt_connection_and_frame_color 808080
_tide_display_prompt
_tide_display_prompt fake_tide_prompt_frame_and_connection_color 808080
_tide_option 2 Light
_set_prompt_connection_and_frame_color 6C6C6C
_tide_display_prompt
_tide_display_prompt fake_tide_prompt_frame_and_connection_color 6C6C6C
_tide_option 3 Dark
_set_prompt_connection_and_frame_color 585858
_tide_display_prompt
_tide_display_prompt fake_tide_prompt_frame_and_connection_color 585858
_tide_option 4 Darkest
_set_prompt_connection_and_frame_color 444444
_tide_display_prompt
_tide_display_prompt fake_tide_prompt_frame_and_connection_color 444444
_tide_menu
switch $_tide_selected_option
case 1
_set_prompt_connection_and_frame_color 808080
set -g fake_tide_prompt_frame_and_connection_color 808080
case 2
_set_prompt_connection_and_frame_color 6C6C6C
set -g fake_tide_prompt_frame_and_connection_color 6C6C6C
case 3
_set_prompt_connection_and_frame_color 585858
set -g fake_tide_prompt_frame_and_connection_color 585858
case 4
_set_prompt_connection_and_frame_color 444444
set -g fake_tide_prompt_frame_and_connection_color 444444
end
_next_choice all/prompt_spacing
end
function _set_prompt_connection_and_frame_color -a color
set -g fake_tide_prompt_connection_color $color
set -g fake_tide_left_prompt_frame_color $color
set -g fake_tide_right_prompt_frame_color $color
end

View File

@ -31,7 +31,6 @@ tide_git_upstream_color $_tide_color_green
tide_jobs_bg_color 444444
tide_jobs_color $_tide_color_dark_green
tide_jobs_icon ''
tide_left_prompt_frame_color 6C6C6C
tide_left_prompt_frame_enabled true
tide_left_prompt_item_separator_diff_color ''
tide_left_prompt_item_separator_same_color ''
@ -49,8 +48,8 @@ tide_php_bg_color 444444
tide_php_color 875FFF
tide_php_icon ''
tide_prompt_add_newline_before true
tide_prompt_connection_color 6C6C6C
tide_prompt_connection_icon ' '
tide_prompt_frame_and_connection_color 6C6C6C
tide_prompt_pad_items true
tide_pwd_bg_color 444444
tide_pwd_color_anchors $_tide_color_light_blue
@ -61,7 +60,6 @@ tide_pwd_home_icon
tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform Cargo.toml composer.json CVS go.mod package.json
tide_pwd_truncate_margin 10
tide_pwd_unwritable_icon ''
tide_right_prompt_frame_color 6C6C6C
tide_right_prompt_frame_enabled true
tide_right_prompt_item_separator_diff_color ''
tide_right_prompt_item_separator_same_color ''

View File

@ -1,3 +1,8 @@
tide_character_bg_color normal
tide_character_failure_color brred
tide_character_success_color brgreen
tide_chruby_bg_color black
tide_chruby_color red
tide_cmd_duration_bg_color black
tide_cmd_duration_color brblack
tide_context_bg_color black
@ -15,7 +20,6 @@ tide_git_untracked_color brblue
tide_git_upstream_color brgreen
tide_jobs_bg_color black
tide_jobs_color green
tide_left_prompt_frame_color brblack
tide_left_prompt_item_separator_same_color_color brblack
tide_nvm_bg_color black
tide_nvm_color cyan
@ -23,18 +27,12 @@ tide_os_bg_color black
tide_os_color brwhite
tide_php_bg_color black
tide_php_color brmagenta
tide_character_bg_color normal
tide_character_failure_color brred
tide_character_success_color brgreen
tide_prompt_connection_color brblack
tide_prompt_frame_and_connection_color brblack
tide_pwd_bg_color black
tide_pwd_color_anchors brcyan
tide_pwd_color_dirs cyan
tide_pwd_color_truncated_dirs magenta
tide_right_prompt_frame_color brblack
tide_right_prompt_item_separator_same_color_color brblack
tide_chruby_bg_color black
tide_chruby_color red
tide_rustc_bg_color black
tide_rustc_color cyan
tide_status_failure_bg_color black

View File

@ -32,7 +32,6 @@ tide_git_upstream_color $_tide_color_green
tide_jobs_bg_color normal
tide_jobs_color $_tide_color_dark_green
tide_jobs_icon ''
tide_left_prompt_frame_color 6C6C6C
tide_left_prompt_frame_enabled false
tide_left_prompt_item_separator_diff_color ' '
tide_left_prompt_item_separator_same_color ' '
@ -50,8 +49,8 @@ tide_php_bg_color normal
tide_php_color 875FFF
tide_php_icon ''
tide_prompt_add_newline_before true
tide_prompt_connection_color 6C6C6C
tide_prompt_connection_icon ' '
tide_prompt_frame_and_connection_color 6C6C6C
tide_prompt_pad_items false
tide_pwd_bg_color normal
tide_pwd_color_anchors $_tide_color_light_blue
@ -62,7 +61,6 @@ tide_pwd_home_icon
tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform Cargo.toml composer.json CVS go.mod package.json
tide_pwd_truncate_margin 10
tide_pwd_unwritable_icon ''
tide_right_prompt_frame_color 6C6C6C
tide_right_prompt_frame_enabled false
tide_right_prompt_item_separator_diff_color ' '
tide_right_prompt_item_separator_same_color ' '

View File

@ -1,3 +1,8 @@
tide_character_bg_color normal
tide_character_failure_color brred
tide_character_success_color brgreen
tide_chruby_bg_color normal
tide_chruby_color red
tide_cmd_duration_bg_color normal
tide_cmd_duration_color brblack
tide_context_bg_color normal
@ -15,7 +20,6 @@ tide_git_untracked_color brblue
tide_git_upstream_color brgreen
tide_jobs_bg_color normal
tide_jobs_color green
tide_left_prompt_frame_color brblack
tide_left_prompt_item_separator_same_color_color brblack
tide_nvm_bg_color normal
tide_nvm_color cyan
@ -23,18 +27,12 @@ tide_os_bg_color normal
tide_os_color brwhite
tide_php_bg_color normal
tide_php_color brmagenta
tide_character_bg_color normal
tide_character_failure_color brred
tide_character_success_color brgreen
tide_prompt_connection_color brblack
tide_prompt_frame_and_connection_color brblack
tide_pwd_bg_color normal
tide_pwd_color_anchors brcyan
tide_pwd_color_dirs cyan
tide_pwd_color_truncated_dirs magenta
tide_right_prompt_frame_color brblack
tide_right_prompt_item_separator_same_color_color brblack
tide_chruby_bg_color normal
tide_chruby_color red
tide_rustc_bg_color normal
tide_rustc_color cyan
tide_status_failure_bg_color normal

View File

@ -32,7 +32,6 @@ tide_git_upstream_color 000000
tide_jobs_bg_color 444444
tide_jobs_color 4E9A06
tide_jobs_icon ''
tide_left_prompt_frame_color 6C6C6C
tide_left_prompt_frame_enabled true
tide_left_prompt_item_separator_diff_color ''
tide_left_prompt_item_separator_same_color ''
@ -50,8 +49,8 @@ tide_php_bg_color 75507B
tide_php_color 000000
tide_php_icon ''
tide_prompt_add_newline_before true
tide_prompt_connection_color 6C6C6C
tide_prompt_connection_icon ' '
tide_prompt_frame_and_connection_color 6C6C6C
tide_prompt_pad_items true
tide_pwd_bg_color 3465A4
tide_pwd_color_anchors E4E4E4
@ -62,7 +61,6 @@ tide_pwd_home_icon
tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform Cargo.toml composer.json CVS go.mod package.json
tide_pwd_truncate_margin 10
tide_pwd_unwritable_icon ''
tide_right_prompt_frame_color 6C6C6C
tide_right_prompt_frame_enabled true
tide_right_prompt_item_separator_diff_color ''
tide_right_prompt_item_separator_same_color ''

View File

@ -1,3 +1,8 @@
tide_character_bg_color normal
tide_character_failure_color brred
tide_character_success_color brgreen
tide_chruby_bg_color red
tide_chruby_color black
tide_cmd_duration_bg_color yellow
tide_cmd_duration_color black
tide_context_bg_color brblack
@ -15,7 +20,6 @@ tide_git_untracked_color black
tide_git_upstream_color black
tide_jobs_bg_color brblack
tide_jobs_color green
tide_left_prompt_frame_color brblack
tide_left_prompt_item_separator_same_color_color brblack
tide_nvm_bg_color magenta
tide_nvm_color black
@ -23,18 +27,12 @@ tide_os_bg_color white
tide_os_color black
tide_php_bg_color magenta
tide_php_color black
tide_character_bg_color normal
tide_character_failure_color brred
tide_character_success_color brgreen
tide_prompt_connection_color brblack
tide_prompt_frame_and_connection_color brblack
tide_pwd_bg_color blue
tide_pwd_color_anchors brwhite
tide_pwd_color_dirs brwhite
tide_pwd_color_truncated_dirs white
tide_right_prompt_frame_color brblack
tide_right_prompt_item_separator_same_color_color brblack
tide_chruby_bg_color red
tide_chruby_color black
tide_rustc_bg_color yellow
tide_rustc_color black
tide_status_failure_bg_color red