summaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-05-27 20:52:57 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-05-27 20:52:57 +0300
commite8f2c1aa6fee1eeb3cda000d037f36b7f587c3da (patch)
tree5fe1e7afc75954e9bb15ffddcb12339acc1a06bd /powerlevel9k.zsh-theme
parenta405d8af70343f3fc652af5e62731c3c0e2b5f81 (diff)
add powerlevel9k_refresh_prompt_inplace that users can from zle widgets to refresh prompt inplace
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme24
1 files changed, 15 insertions, 9 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 7e792cd4..260dc311 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -2196,23 +2196,29 @@ function _p9k_update_prompt() {
typeset -gi _P9K_REGION_ACTIVE
set_default POWERLEVEL9K_PROMPT_ADD_NEWLINE false
+
+powerlevel9k_refresh_prompt_inplace() {
+ emulate -L zsh
+
+ _p9k_init
+
+ _P9K_REFRESH_REASON=precmd
+ _p9k_set_prompt
+ _P9K_REFRESH_REASON=''
+}
+
powerlevel9k_prepare_prompts() {
- # Do not move these lines down, otherwise the last command is not what you expected it to be.
_P9K_EXIT_CODE=$?
_P9K_PIPE_EXIT_CODES=( "$pipestatus[@]" )
_P9K_COMMAND_DURATION=$((EPOCHREALTIME - _P9K_TIMER_START))
+ _P9K_TIMER_START=1e10
+ _P9K_REGION_ACTIVE=0
- unsetopt local_options
+ unsetopt localoptions
prompt_opts=(cr percent sp subst)
setopt nopromptbang prompt{cr,percent,sp,subst}
- _p9k_init
- _P9K_TIMER_START=1e10
- _P9K_REGION_ACTIVE=0
-
- _P9K_REFRESH_REASON=precmd
- _p9k_set_prompt
- _P9K_REFRESH_REASON=''
+ powerlevel9k_refresh_prompt_inplace
}
function _p9k_zle_keymap_select() {