File tree Expand file tree Collapse file tree 2 files changed +5
-39
lines changed
Expand file tree Collapse file tree 2 files changed +5
-39
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -146,7 +146,8 @@ cal-tui::main_menu_return_index() {
146146 local max_len=0
147147 for line in " ${menu_lines[@]} " ; do
148148 # Remove ANSI escape codes before counting length
149- local stripped=$( echo -e " $line " | sed ' s/\x1B\[[0-9;]*[a-zA-Z]//g' )
149+ local stripped
150+ stripped=$( echo -e " $line " | sed ' s/\x1B\[[0-9;]*[a-zA-Z]//g' )
150151 local len=${# stripped}
151152 (( len > max_len )) && max_len=$len
152153 done
@@ -160,7 +161,7 @@ cal-tui::main_menu_return_index() {
160161
161162 # Print each line at the same horizontal offset
162163 for line in " ${menu_lines[@]} " ; do
163- printf " %*s%s\n" " $start_col " " " " $line "
164+ printf " %*s%s\n" " $start_col " " " " $line "
164165 done
165166
166167 # Input prompt aligned to the same column
@@ -171,7 +172,8 @@ cal-tui::main_menu_return_index() {
171172 if [[ " $choice " -eq 0 ]]; then
172173 return 1
173174 fi
174- RETURNED_INDEX=$(( choice - 1 ))
175+ # shellcheck disable=SC2034
176+ RETURNED_INDEX=$(( choice - 1 )) # Used externally as the choice result
175177 return 0
176178 else
177179 cal-tui::print_error " Invalid choice. Try again."
You can’t perform that action at this time.
0 commit comments