From 5ee0e77ea2c4ed8d7cbb4b800003f56b15dbfb28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20=C3=84lgmyr?= Date: Sun, 14 Apr 2024 23:20:26 +0200 Subject: [PATCH] Inline labeling and build a single label. --- cli/src/config/colors.toml | 10 ++++---- cli/src/config/templates.toml | 43 +++++++++++++++-------------------- 2 files changed, 22 insertions(+), 31 deletions(-) diff --git a/cli/src/config/colors.toml b/cli/src/config/colors.toml index dde26f15ae..635a66f6db 100644 --- a/cli/src/config/colors.toml +++ b/cli/src/config/colors.toml @@ -88,10 +88,8 @@ "op_log current_operation user" = "yellow" # No bright yellow, see comment above "op_log current_operation time" = "bright cyan" -"node" = { bold = true } "node elided" = { fg = "bright black" } -"node working_copy" = { fg = "green" } -"node current_operation" = { fg = "green" } -"node immutable" = { fg = "bright cyan" } -"node conflict" = { fg = "red" } -"node normal" = { bold = false } +"node working_copy" = { fg = "green", bold = true } +"node current_operation" = { fg = "green", bold = true } +"node immutable" = { fg = "bright cyan", bold = true } +"node conflict" = { fg = "red", bold = true } diff --git a/cli/src/config/templates.toml b/cli/src/config/templates.toml index 332b973393..72f01b2091 100644 --- a/cli/src/config/templates.toml +++ b/cli/src/config/templates.toml @@ -166,29 +166,15 @@ if(hidden, ) ''' -'label_log_node(content)' = ''' -label("node", - coalesce( - if(!self, label("elided", content)), - if(immutable, label("immutable", content)), - if(conflict, label("conflict", content)), - if(current_working_copy, label("working_copy", content)), - label("normal", content), - ) -) -''' - -'label_op_log_node(content)' = ''' -label("node", - coalesce( - if(current_operation, label("current_operation", content)), - label("normal", content), - ) -) -''' - builtin_log_node = ''' -label_log_node( +label("node" ++ + if( + self, + if(current_working_copy, " working_copy") + ++ if(immutable, " immutable") + ++ if(conflict, " conflict"), + " elided" + ), coalesce( if(!self, "~"), if(current_working_copy, "@"), @@ -200,7 +186,14 @@ label_log_node( ''' builtin_log_node_ascii = ''' -label_log_node( +label("node" ++ + if( + self, + if(current_working_copy, " working_copy") + ++ if(immutable, " immutable") + ++ if(conflict, " conflict"), + " elided" + ), coalesce( if(!self, "~"), if(current_working_copy, "@"), @@ -212,7 +205,7 @@ label_log_node( ''' builtin_op_log_node = ''' -label_op_log_node( +label("node" ++ if(current_operation, " current_operation"), coalesce( if(current_operation, "@"), "○", @@ -221,7 +214,7 @@ label_op_log_node( ''' builtin_op_log_node_ascii = ''' -label_op_log_node( +label("node" ++ if(current_operation, " current_operation"), coalesce( if(current_operation, "@"), "o",