1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-25 21:40:08 +00:00

don't compute git status if POWERLEVEL9K_VCS_DISABLED_DIR_PATTERN matches

This commit is contained in:
romkatv 2020-02-24 14:11:33 +01:00
parent 7e262fb912
commit 4a4c43aa9a

View file

@ -3688,7 +3688,7 @@ function _p9k_vcs_resume() {
fi fi
if (( _p9k_vcs_index && $+GITSTATUS_DAEMON_PID_POWERLEVEL9K )); then if (( _p9k_vcs_index && $+GITSTATUS_DAEMON_PID_POWERLEVEL9K )); then
local _p9k__prompt _p9k__prompt_side=$_p9k_vcs_side local _p9k__prompt _p9k__prompt_side=$_p9k_vcs_side _p9k__segment_name=vcs
local -i _p9k__has_upglob _p9k__segment_index=_p9k_vcs_index local -i _p9k__has_upglob _p9k__segment_index=_p9k_vcs_index
_p9k_vcs_render _p9k_vcs_render
typeset -g _p9k__vcs=$_p9k__prompt typeset -g _p9k__vcs=$_p9k__prompt
@ -6052,11 +6052,15 @@ _p9k_precmd_impl() {
_p9k__refresh_reason=precmd _p9k__refresh_reason=precmd
__p9k_reset_state=1 __p9k_reset_state=1
local -i fast_vcs
if (( _p9k_vcs_index && $+GITSTATUS_DAEMON_PID_POWERLEVEL9K )); then if (( _p9k_vcs_index && $+GITSTATUS_DAEMON_PID_POWERLEVEL9K )); then
if [[ $_p9k__cwd != $~_POWERLEVEL9K_VCS_DISABLED_DIR_PATTERN ]]; then
local -F start_time=EPOCHREALTIME local -F start_time=EPOCHREALTIME
unset _p9k__vcs unset _p9k__vcs
unset _p9k__vcs_timeout unset _p9k__vcs_timeout
_p9k_vcs_gitstatus _p9k_vcs_gitstatus
local -i fast_vcs=1
fi
fi fi
local f_compute local f_compute
@ -6083,14 +6087,14 @@ _p9k_precmd_impl() {
preexec_functions=(${(@)preexec_functions:#_p9k_preexec2} _p9k_preexec2) preexec_functions=(${(@)preexec_functions:#_p9k_preexec2} _p9k_preexec2)
fi fi
if (( _p9k_vcs_index && $+GITSTATUS_DAEMON_PID_POWERLEVEL9K )); then if (( fast_vcs && _p9k_vcs_index && $+GITSTATUS_DAEMON_PID_POWERLEVEL9K )); then
if (( $+_p9k__vcs_timeout )); then if (( $+_p9k__vcs_timeout )); then
(( _p9k__vcs_timeout = _POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS + start_time - EPOCHREALTIME )) (( _p9k__vcs_timeout = _POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS + start_time - EPOCHREALTIME ))
(( _p9k__vcs_timeout >= 0 )) || (( _p9k__vcs_timeout = 0 )) (( _p9k__vcs_timeout >= 0 )) || (( _p9k__vcs_timeout = 0 ))
gitstatus_process_results -t $_p9k__vcs_timeout POWERLEVEL9K gitstatus_process_results -t $_p9k__vcs_timeout POWERLEVEL9K
fi fi
if (( ! $+_p9k__vcs )); then if (( ! $+_p9k__vcs )); then
local _p9k__prompt _p9k__prompt_side=$_p9k_vcs_side local _p9k__prompt _p9k__prompt_side=$_p9k_vcs_side _p9k__segment_name=vcs
local -i _p9k__has_upglob _p9k__segment_index=_p9k_vcs_index local -i _p9k__has_upglob _p9k__segment_index=_p9k_vcs_index
_p9k_vcs_render _p9k_vcs_render
typeset -g _p9k__vcs=$_p9k__prompt typeset -g _p9k__vcs=$_p9k__prompt