diff options
author | Maxim Baz <github@maximbaz.com> | 2021-05-15 14:37:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-15 14:37:58 +0300 |
commit | 9c034101fe3cec1e2edb8e07c32a3e6dba9afaee (patch) | |
tree | 7bfac7f15a953efc1ed021a293f33975e7e1b954 /internal/p10k.zsh | |
parent | f924646194e95c9ef0423d0e6c10cf41cc7bf6b1 (diff) |
Add xplr segment (#1396)
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r-- | internal/p10k.zsh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh index d840e0d8..d96daa7d 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4753,6 +4753,20 @@ function instant_prompt_nnn() { _p9k_prompt_segment prompt_nnn 6 $_p9k_color1 NNN_ICON 1 '${NNNLVL:#0}' '$NNNLVL' } +function prompt_xplr() { + local -i len=$#_p9k__prompt _p9k__has_upglob + _p9k_prompt_segment $0 6 $_p9k_color1 XPLR_ICON 0 '' '' + (( _p9k__has_upglob )) || typeset -g "_p9k__segment_val_${_p9k__prompt_side}[_p9k__segment_index]"=$_p9k__prompt[len+1,-1] +} + +_p9k_prompt_xplr_init() { + typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$XPLR_PID' +} + +function instant_prompt_xplr() { + _p9k_prompt_segment prompt_xplr 6 $_p9k_color1 XPLR_ICON 0 '$XPLR_PID' '' +} + function prompt_vim_shell() { local -i len=$#_p9k__prompt _p9k__has_upglob _p9k_prompt_segment $0 green $_p9k_color1 VIM_ICON 0 '' '' |