Minor optimizations

This commit is contained in:
Ilan Cosman 2020-09-08 07:43:51 -07:00
parent 43469e4be8
commit 65dd379f3c
6 changed files with 10 additions and 14 deletions

View File

@ -1,9 +1,7 @@
function _tide_item_rust
if command --quiet rustc && test -e Cargo.toml -o (count *.rs) -gt 0
set -l rustVersion (rustc --version | string split ' ')[2]
if set -l rustVersion (rustc --version | string split ' ')[2] && test -e Cargo.toml -o (count *.rs) -gt 0
if test "$tide_rust_verbose_version" = false
set rustVersion (string split '-' $rustVersion)[1] # Cut off -suffixes from version. "v1.30.0-beta" vs "v1.30.0"
set rustVersion (string split '-' $rustVersion)[1] # Cut off -suffixes. "v1.30.0-beta" vs "v1.30.0"
end
set_color $tide_rust_color

View File

@ -1,13 +1,11 @@
function _tide_item_virtual_env
if set -q VIRTUAL_ENV
set -l splitVirtualEnv (string split '/' "$VIRTUAL_ENV")
if set -l splitVirtualEnv (string split '/' "$VIRTUAL_ENV")
set_color $tide_virtual_env_color
if test "$tide_virtual_env_display_mode" = 'projectName'
printf '%s' $tide_virtual_env_icon' ' $splitVirtualEnv[-2]
else if test "$tide_virtual_env_display_mode" = 'venvName'
if test "$tide_virtual_env_display_mode" = 'venvName'
printf '%s' $tide_virtual_env_icon' ' $splitVirtualEnv[-1]
else # Default to projectName
printf '%s' $tide_virtual_env_icon' ' $splitVirtualEnv[-2]
end
end
end

View File

@ -72,7 +72,7 @@ tide_right_prompt_suffix ''
tide_rust_bg_color 444444
tide_rust_color 00AFAF
tide_rust_icon ''
tide_rust_verbose_version false
tide_rust_verbose_version true
tide_status_always_display false
tide_status_failure_bg_color 444444
tide_status_failure_color D70000

View File

@ -72,7 +72,7 @@ tide_right_prompt_suffix ''
tide_rust_bg_color normal
tide_rust_color 00AFAF
tide_rust_icon ''
tide_rust_verbose_version false
tide_rust_verbose_version true
tide_status_always_display false
tide_status_failure_bg_color normal
tide_status_failure_color D70000

View File

@ -72,7 +72,7 @@ tide_right_prompt_suffix ''
tide_rust_bg_color normal
tide_rust_color 00AFAF
tide_rust_icon ''
tide_rust_verbose_version false
tide_rust_verbose_version true
tide_status_always_display false
tide_status_failure_bg_color normal
tide_status_failure_color D70000

View File

@ -72,7 +72,7 @@ tide_right_prompt_suffix ''
tide_rust_bg_color FF8700
tide_rust_color 2E3436
tide_rust_icon ''
tide_rust_verbose_version false
tide_rust_verbose_version true
tide_status_always_display false
tide_status_failure_bg_color CC0000
tide_status_failure_color FFFF00