Skip to content

Commit

Permalink
prompt: support "contrib/prompt-git" dirty checking
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Feb 6, 2022
1 parent 0abc15b commit 50a0094
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/util.sh
Expand Up @@ -2354,6 +2354,14 @@ function ble/util/clock/.initialize {
local now; printf -v now '%(%s)T'
((ret=(now-_ble_util_clock_base)*1000))
}
elif [[ $SECONDS && ! ${SECONDS//[0-9]} ]]; then
_ble_util_clock_base=$SECONDS
_ble_util_clock_reso=1000
_ble_util_clock_type=SECONDS
function ble/util/clock {
local now=$SECONDS
((ret=(now-_ble_util_clock_base)*1000))
}
else
ble/util/strftime -v _ble_util_clock_base '%s'
_ble_util_clock_reso=1000
Expand Down Expand Up @@ -2483,7 +2491,7 @@ if ((_ble_bash>=40000)); then
##
_ble_util_idle_task=()

## 関数 ble/util/idle.do
## @fn ble/util/idle.do
## 待機状態の処理を開始します。
##
## @exit
Expand Down Expand Up @@ -2652,6 +2660,16 @@ if ((_ble_bash>=40000)); then
function ble/util/idle.push-background {
ble/util/idle.push/.impl 10000 "R:$*"
}
function ble/util/idle.cancel {
local command=$1 i removed=
for i in "${!_ble_util_idle_task[@]}"; do
[[ ${_ble_util_idle_task[i]} == *:"$command" ]] &&
unset -v '_ble_util_idle_task[i]' &&
removed=1
done
[[ $removed ]]
}

function ble/util/is-running-in-idle {
[[ ${ble_util_idle_status+set} ]]
}
Expand Down

0 comments on commit 50a0094

Please sign in to comment.