2021-08-22 01:05:08 +03:00
|
|
|
function _tide_cache_variables
|
|
|
|
# pwd
|
2021-11-04 08:07:15 +03:00
|
|
|
set -l data (
|
|
|
|
# pwd
|
|
|
|
set_color -o $tide_pwd_color_anchors
|
|
|
|
echo
|
|
|
|
set_color $tide_pwd_color_truncated_dirs
|
|
|
|
echo
|
|
|
|
set_color normal -b $tide_pwd_bg_color; set_color $tide_pwd_color_dirs
|
|
|
|
echo
|
|
|
|
# Same-color-separator color
|
|
|
|
set_color $tide_prompt_color_separator_same_color
|
|
|
|
echo
|
|
|
|
# git
|
|
|
|
set_color $tide_git_color_branch
|
|
|
|
)
|
|
|
|
|
|
|
|
# pwd
|
|
|
|
set -gx _tide_color_anchors "$data[1]"
|
|
|
|
set -gx _tide_color_truncated_dirs "$data[2]"
|
|
|
|
set -gx _tide_reset_to_color_dirs "$data[3]"
|
|
|
|
|
|
|
|
# Same-color-separator color
|
|
|
|
set -gx _tide_color_separator_same_color "$data[4]"
|
2021-08-22 01:05:08 +03:00
|
|
|
|
|
|
|
# git
|
2021-11-04 08:07:15 +03:00
|
|
|
contains git $tide_left_prompt_items $tide_right_prompt_items && set -gx _tide_location_color "$data[5]"
|
2021-08-22 01:05:08 +03:00
|
|
|
|
2021-10-03 22:05:43 +03:00
|
|
|
# private_mode
|
|
|
|
if contains private_mode $tide_left_prompt_items $tide_right_prompt_items && test -n "$fish_private_mode"
|
|
|
|
set -gx _tide_private_mode
|
|
|
|
else
|
|
|
|
set -e _tide_private_mode
|
|
|
|
end
|
|
|
|
|
2021-08-22 01:05:08 +03:00
|
|
|
# two line prompt
|
2021-09-15 20:16:36 +03:00
|
|
|
if contains newline $tide_left_prompt_items
|
2021-09-09 04:15:45 +03:00
|
|
|
set_color $tide_prompt_color_frame_and_connection -b normal | read -gx _tide_prompt_and_frame_color
|
2021-09-15 20:16:36 +03:00
|
|
|
else
|
|
|
|
set -e _tide_prompt_and_frame_color
|
|
|
|
end
|
2021-08-22 01:05:08 +03:00
|
|
|
|
|
|
|
# newline before
|
2021-10-26 20:50:54 +03:00
|
|
|
test "$tide_prompt_add_newline_before" = true && set -g _tide_add_newline '' || set -e _tide_add_newline
|
2021-09-22 23:35:33 +03:00
|
|
|
|
|
|
|
# item padding
|
2021-10-26 20:50:54 +03:00
|
|
|
test "$tide_prompt_pad_items" = true && set -gx _tide_pad ' ' || set -e _tide_pad
|
2021-08-22 01:05:08 +03:00
|
|
|
end
|