File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -55,13 +55,21 @@ ctrl-branch-command() {
55
55
56
56
# # show menu
57
57
# highlight shortcut letter inline in yellow
58
- # XXX preserve existing color after highlight
58
+ # preserve branch color after hotkey highlight
59
59
i=1
60
60
for m in $MENU ; do
61
+ branch=$BRANCHES [$i ]
62
+
63
+ # get active branch highlight color
64
+ # # strip active branch marker
65
+ m2=${m[3,-1]}
66
+ # # strip everything after branch name
67
+ active_color=${m2%% $branch * }
68
+ # printf "%q\n" $active_color
69
+
61
70
key=$HOTKEYS [$i ]
62
- hot=$fg_bold [yellow]$key$reset_color
71
+ hot=$fg_bold [yellow]$key$reset_color$active_color
63
72
# replace key in branch name with highlight
64
- branch=$BRANCHES [$i ]
65
73
hotbr=${branch/ $key / $hot }
66
74
67
75
print ${m/ $branch / $hotbr }
You can’t perform that action at this time.
0 commit comments