1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-12 18:05:13 +00:00

Well-structured output

This commit is contained in:
Tw93
2025-10-11 22:43:18 +08:00
parent 3b33c5a4a8
commit 55f6bd352f
7 changed files with 126 additions and 69 deletions

View File

@@ -262,6 +262,14 @@ EOF
fi
done
if [[ ${#selected_indices[@]} -eq 0 ]]; then
local default_idx=$((top_index + cursor_pos))
if [[ $default_idx -ge 0 && $default_idx -lt $total_items ]]; then
selected[default_idx]=true
selected_indices=("$default_idx")
fi
fi
local final_result=""
if [[ ${#selected_indices[@]} -gt 0 ]]; then
local IFS=','