File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -814,6 +814,7 @@ You can customize the color of branches based on the branch prefix:
814814gui: 
815815  branchColors: 
816816    'docs': '#11aaff' # use a light blue for branches beginning with 'docs/' 
817+     'ISSUE-*': '#ff5733' # use a bright orange for branches beginning with 'ISSUE-' 
817818` ` ` 
818819
819820# # Example Coloring
Original file line number Diff line number Diff line change @@ -123,6 +123,19 @@ func getBranchDisplayStrings(
123123	return  res 
124124}
125125
126+ func  matchColorPrefix (name  string ) (style.TextStyle , bool ) {
127+ 	for  possiblePattern , color  :=  range  branchPrefixColorCache  {
128+ 		if  strings .Contains (possiblePattern , "*" ) {
129+ 			prefix  :=  strings .TrimSuffix (possiblePattern , "*" )
130+ 			if  strings .HasPrefix (name , prefix ) {
131+ 				return  color , true 
132+ 			}
133+ 		}
134+ 	}
135+ 
136+ 	return  style.TextStyle {}, false 
137+ }
138+ 
126139// GetBranchTextStyle branch color 
127140func  GetBranchTextStyle (name  string ) style.TextStyle  {
128141	branchType  :=  strings .Split (name , "/" )[0 ]
@@ -131,6 +144,10 @@ func GetBranchTextStyle(name string) style.TextStyle {
131144		return  value 
132145	}
133146
147+ 	if  value , ok  :=  matchColorPrefix (name ); ok  {
148+ 		return  value 
149+ 	}
150+ 
134151	switch  branchType  {
135152	case  "feature" :
136153		return  style .FgGreen 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments