Skip to content

Commit 8640e47

Browse files
committed
Menu headings optionally in bold
1 parent 449ae3a commit 8640e47

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

EasyKey.git/ezk-git-diff.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ diffStatus() {
9191
echo "Note: GIT diff cann compare four locations with each other: "
9292
echo " your working directory, the stage, the repository."
9393
echo
94-
coloredLog "┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐" "$clrPurple" "$clrBlack"
95-
coloredLog "│ │ │ │ │ │ │ │" "$clrPurple" "$clrBlack"
96-
coloredLog "│ │ -> │ │ -> │ │ -> │ │" "$clrPurple" "$clrBlack"
97-
coloredLog "└────────┘ └────────┘ └────────┘ └────────┘" "$clrPurple" "$clrBlack"
98-
coloredLog " work dir stage local repo remote repo" "$clrWhite" "$clrBlack"
94+
coloredLog "┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐" "$clrPurple" "$clrBlack" && printf "\n\r"
95+
coloredLog "│ │ │ │ │ │ │ │" "$clrPurple" "$clrBlack" && printf "\n\r"
96+
coloredLog "│ │ -> │ │ -> │ │ -> │ │" "$clrPurple" "$clrBlack" && printf "\n\r"
97+
coloredLog "└────────┘ └────────┘ └────────┘ └────────┘" "$clrPurple" "$clrBlack" && printf "\n\r"
98+
coloredLog " work dir stage local repo remote repo" "$clrWhite" "$clrBlack" && printf "\n\r"
9999
}
100100

101101
git fetch --all

shellmenu.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ submenuBGClr="$clrBlack" # the default sub menu heading background co
2727
delimiter=⊕ # the delimiter used in menu array
2828
submenu_pad_symbol="" # Default submenu border symbol
2929
submenu_corner_symbol="" # Default submenu corner symbol
30+
sub_menu_bold=false # whether to print out submenu bold
3031

3132
# Internal global variables (DO NOT CHANGE)
3233
formattedheading="" # the cache for formatted heading
@@ -142,10 +143,13 @@ startMenu() {
142143
# $1: log text
143144
# $2: optional: foreground color
144145
# $3: optional: background color
146+
# $4: optional: bold
145147
# Outputs:
146148
# Writes colored log to standard out
147149
#######################################
148150
coloredLog () {
151+
local bold=${4:-false}
152+
$bold && printf "\033[1m\e[38;5;%sm\e[48;5;%sm%s\e[38;5;7m\e[48;5;0m\033[0m" "$2" "$3" "$1" && return
149153
printf "\e[38;5;%sm\e[48;5;%sm%s\e[38;5;7m\e[48;5;0m" "$2" "$3" "$1"
150154
}
151155

@@ -570,7 +574,7 @@ printSubmenuHeading(){
570574
local width="${2:-$calculatedMenuWidth}"
571575
local symbol="${3:-$submenu_pad_symbol}"
572576
local paddedline="$(r_pad "$1" "$width" "$symbol")$submenu_corner_symbol"
573-
coloredLog "$paddedline\n\r" "$submenuFGClr" "$submenuBGClr"
577+
coloredLog "$paddedline\n\r" "$submenuFGClr" "$submenuBGClr" $sub_menu_bold
574578
}
575579

576580
#################################################

0 commit comments

Comments
 (0)