mirror of
https://github.com/tw93/Mole.git
synced 2026-02-10 00:54:15 +00:00
fix: adjust header underline rendering in paginated menu
This commit is contained in:
@@ -82,12 +82,14 @@ paginated_multi_select() {
|
|||||||
draw_menu() {
|
draw_menu() {
|
||||||
printf "\033[H\033[J" >&2 # Clear screen and move to top
|
printf "\033[H\033[J" >&2 # Clear screen and move to top
|
||||||
|
|
||||||
# Header - strip emoji for length calculation
|
# Header - compute underline length without external seq dependency
|
||||||
local title_clean="${title//[^[:print:]]/}"
|
local title_clean="${title//[^[:print:]]/}"
|
||||||
local title_len_approx=$(( ${#title_clean} - 4 )) # Rough adjustment for emoji
|
local underline_len=${#title_clean}
|
||||||
[[ $title_len_approx -lt 10 ]] && title_len_approx=10
|
[[ $underline_len -lt 10 ]] && underline_len=10
|
||||||
|
# Build underline robustly (no seq); printf width then translate spaces to '='
|
||||||
printf "${PURPLE}%s${NC}\n%s\n" "$title" "$(printf '=%.0s' $(seq 1 $title_len_approx))" >&2
|
local underline
|
||||||
|
underline=$(printf '%*s' "$underline_len" '' | tr ' ' '=')
|
||||||
|
printf "${PURPLE}%s${NC}\n%s\n" "$title" "$underline" >&2
|
||||||
|
|
||||||
# Status
|
# Status
|
||||||
local selected_count=0
|
local selected_count=0
|
||||||
|
|||||||
Reference in New Issue
Block a user