From 054eb351f1d7d92d810259e3a5fbfd9e025b2d08 Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Fri, 6 Apr 2018 11:33:02 -0700 Subject: [PATCH] Revert "Only call reset-prompt when the appropriate zstyle is set" This reverts commit 6d00fdf8c8e4003a89d622590265d80356a7a95f. As unfortunate as it is, this workaround was a hack and doesn't take into account prompts like spaceship which don't use $editor_info but rely on $KEYMAP directly. We'll need to find a more consistent solution to fix this. --- modules/editor/README.md | 2 -- modules/editor/init.zsh | 15 +++++++-------- modules/prompt/functions/prompt_smiley_setup | 2 +- runcoms/zpreztorc | 3 +++ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/editor/README.md b/modules/editor/README.md index f079961..c27e864 100644 --- a/modules/editor/README.md +++ b/modules/editor/README.md @@ -26,8 +26,6 @@ zstyle ':prezto:module:editor' dot-expansion 'yes' ### PS Context -**NOTE:** *This is deprecated and will be removed in future versions.* - To enable the prompt context to be set, add the following to your *zpreztorc*. diff --git a/modules/editor/init.zsh b/modules/editor/init.zsh index df019e7..085947e 100644 --- a/modules/editor/init.zsh +++ b/modules/editor/init.zsh @@ -116,21 +116,20 @@ function editor-info { } zle -N editor-info -# Reset the prompt based on the current context and whether the prompt utilizes -# the editor:info zstyle. If the prompt does utilize the editor:info, we must -# reset the prompt, otherwise the change in the prompt will never update. If the -# prompt does not utilize the editor:info, we simply redisplay the command line. +# Reset the prompt based on the current context and +# the ps-context option. function zle-reset-prompt { - # Explicitly check to see if there is an editor info keymap set that would - # require a reset of the prompt - if zstyle -L ':prezto:module:editor:info*' | grep -v 'completing' > /dev/null 2>&1; then + if zstyle -t ':prezto:module:editor' ps-context; then # If we aren't within one of the specified contexts, then we want to reset # the prompt with the appropriate editor_info[keymap] if there is one. if [[ $CONTEXT != (select|cont) ]]; then zle reset-prompt + zle -R fi + else + zle reset-prompt + zle -R fi - zle -R } zle -N zle-reset-prompt diff --git a/modules/prompt/functions/prompt_smiley_setup b/modules/prompt/functions/prompt_smiley_setup index 3d41b3a..3066a2d 100644 --- a/modules/prompt/functions/prompt_smiley_setup +++ b/modules/prompt/functions/prompt_smiley_setup @@ -36,7 +36,7 @@ function prompt_smiley_precmd { function prompt_smiley_setup { unsetopt XTRACE KSH_ARRAYS - prompt_opts=(cr percent sp subst) + prompt_opts=(percent subst) # Add hook for calling git-info before each command. add-zsh-hook precmd prompt_smiley_precmd diff --git a/runcoms/zpreztorc b/runcoms/zpreztorc index d2a1572..c109155 100644 --- a/runcoms/zpreztorc +++ b/runcoms/zpreztorc @@ -62,6 +62,9 @@ zstyle ':prezto:module:editor' key-bindings 'emacs' # Auto convert .... to ../.. # zstyle ':prezto:module:editor' dot-expansion 'yes' +# Allow the zsh prompt context to be shown. +#zstyle ':prezto:module:editor' ps-context 'yes' + # # Git #