1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 20:50:06 +00:00

chore: auto format code

This commit is contained in:
tw93
2026-02-28 11:03:16 +08:00
parent 1be71edc9d
commit 7d70889ad4
21 changed files with 145 additions and 128 deletions

View File

@@ -138,8 +138,8 @@ truncate_by_display_width() {
fi
truncated+="$char"
((width += char_width))
((i++))
((width += char_width)) || true
((i++)) || true
done
# Restore locale
@@ -265,7 +265,7 @@ read_key() {
drain_pending_input() {
local drained=0
while IFS= read -r -s -n 1 -t 0.01 _ 2> /dev/null; do
((drained++))
((drained++)) || true
[[ $drained -gt 100 ]] && break
done
}
@@ -341,7 +341,7 @@ start_inline_spinner() {
local c="${chars:$((i % ${#chars})):1}"
# Output to stderr to avoid interfering with stdout
printf "\r${MOLE_SPINNER_PREFIX:-}${BLUE}%s${NC} %s" "$c" "$display_message" >&2 || break
((i++))
((i++)) || true
sleep 0.05
done
@@ -367,7 +367,7 @@ stop_inline_spinner() {
local wait_count=0
while kill -0 "$INLINE_SPINNER_PID" 2> /dev/null && [[ $wait_count -lt 5 ]]; do
sleep 0.05 2> /dev/null || true
((wait_count++))
((wait_count++)) || true
done
# Only use SIGKILL as last resort if process is stuck