From f2c26593f00301f5d14da01a255b51d47293dff5 Mon Sep 17 00:00:00 2001 From: MarcoVeio Date: Sat, 3 Feb 2024 22:35:56 -0300 Subject: [PATCH 1/3] feat: time icon --- functions/_tide_item_time.fish | 2 +- functions/tide/configure/icons.fish | 1 + tests/_tide_item_time.test.fish | 13 +++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/functions/_tide_item_time.fish b/functions/_tide_item_time.fish index b8522bc4..332bb398 100644 --- a/functions/_tide_item_time.fish +++ b/functions/_tide_item_time.fish @@ -1,3 +1,3 @@ function _tide_item_time - _tide_print_item time (date +$tide_time_format) + _tide_print_item time $tide_time_icon' ' (date +$tide_time_format) end diff --git a/functions/tide/configure/icons.fish b/functions/tide/configure/icons.fish index 70611cdf..9f74fa1a 100644 --- a/functions/tide/configure/icons.fish +++ b/functions/tide/configure/icons.fish @@ -33,6 +33,7 @@ tide_status_icon ✔ tide_status_icon_failure ✘ tide_terraform_icon 󱁢 tide_toolbox_icon  +tide_time_icon  tide_vi_mode_icon_default D tide_vi_mode_icon_insert I tide_vi_mode_icon_replace R diff --git a/tests/_tide_item_time.test.fish b/tests/_tide_item_time.test.fish index 846a737d..a42cffe8 100644 --- a/tests/_tide_item_time.test.fish +++ b/tests/_tide_item_time.test.fish @@ -5,6 +5,8 @@ function _time -a format LC_TIME=en_US.UTF-8 _tide_decolor (tide_time_format="$format" _tide_item_time) end +set -lx tide_time_icon = + # None _time '' # CHECK: @@ -13,3 +15,14 @@ _time %T # CHECK: {{\d\d:\d\d:\d\d}} # 12 Hour _time %r # CHECK: {{\d\d:\d\d:\d\d (A|P)M}} + +set -lx tide_time_icon =  + +# Only Icon +_time '' # CHECK:  + +# 24 Hour With Icon +_time %T # CHECK:  {{\d\d:\d\d:\d\d}} + +# 12 Hour With Icon +_time %r # CHECK:  {{\d\d:\d\d:\d\d (A|P)M}} From cf41dd68f2ade388e48fcd94be9e8636e6cbbfa4 Mon Sep 17 00:00:00 2001 From: MarcoVeio Date: Sat, 3 Feb 2024 23:05:51 -0300 Subject: [PATCH 2/3] fixing tests --- tests/_tide_item_time.test.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/_tide_item_time.test.fish b/tests/_tide_item_time.test.fish index a42cffe8..227d8ad8 100644 --- a/tests/_tide_item_time.test.fish +++ b/tests/_tide_item_time.test.fish @@ -5,7 +5,7 @@ function _time -a format LC_TIME=en_US.UTF-8 _tide_decolor (tide_time_format="$format" _tide_item_time) end -set -lx tide_time_icon = +set -lx tide_time_icon # None _time '' # CHECK: @@ -16,7 +16,7 @@ _time %T # CHECK: {{\d\d:\d\d:\d\d}} # 12 Hour _time %r # CHECK: {{\d\d:\d\d:\d\d (A|P)M}} -set -lx tide_time_icon =  +set -lx tide_time_icon  # Only Icon _time '' # CHECK:  From fe13ab83cbfb97712c64d1431fd694bbe6f2e1b9 Mon Sep 17 00:00:00 2001 From: MarcoVeio Date: Sat, 3 Feb 2024 23:09:19 -0300 Subject: [PATCH 3/3] linting --- tests/_tide_item_time.test.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/_tide_item_time.test.fish b/tests/_tide_item_time.test.fish index 227d8ad8..37170a8a 100644 --- a/tests/_tide_item_time.test.fish +++ b/tests/_tide_item_time.test.fish @@ -21,7 +21,7 @@ set -lx tide_time_icon  # Only Icon _time '' # CHECK:  -# 24 Hour With Icon +# 24 Hour With Icon _time %T # CHECK:  {{\d\d:\d\d:\d\d}} # 12 Hour With Icon