aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2020-02-26 14:00:13 +0300
committerromkatv <roman.perepelitsa@gmail.com>2020-02-26 14:00:13 +0300
commit3077929e185fa0c5b0646f6fa43c6bc646ea14e2 (patch)
tree29e4cabdec327619885e4ee01252e2518cca75e2
parente7b036418b4c9ca6e0c8f06bc64819484960205a (diff)
simplify code a little bit
-rw-r--r--internal/p10k.zsh32
1 files changed, 15 insertions, 17 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 82941579..369beb99 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -6902,25 +6902,23 @@ function _p9k_wrap_widgets() {
function _p9k_restore_prompt() {
eval "$__p9k_intro"
- {
- (( _p9k__must_restore_prompt )) || return
- _p9k__must_restore_prompt=0
+ zle -F $1
+ exec {1}>&-
+ _p9k__restore_prompt_fd=0
- unset _p9k__line_finished
- _p9k__refresh_reason=restore
- _p9k_set_prompt
- _p9k__refresh_reason=
+ (( _p9k__must_restore_prompt )) || return 0
+ _p9k__must_restore_prompt=0
- local tty=$P9K_TTY
- P9K_TTY=$_p9k__last_tty
- _p9k__expanded=0
- _p9k_reset_prompt
- P9K_TTY=$tty
- } always {
- zle -F $1
- exec {1}>&-
- _p9k__restore_prompt_fd=0
- }
+ unset _p9k__line_finished
+ _p9k__refresh_reason=restore
+ _p9k_set_prompt
+ _p9k__refresh_reason=
+
+ local tty=$P9K_TTY
+ P9K_TTY=$_p9k__last_tty
+ _p9k__expanded=0
+ _p9k_reset_prompt
+ P9K_TTY=$tty
}
prompt__p9k_internal_nothing() { _p9k__prompt+='${_p9k__sss::=}'; }