Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
agkozak committed Sep 11, 2021
2 parents f9156f5 + 9d1e9be commit 4ea022b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions agkozak-zsh-prompt.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ prompt_agkozak-zsh-prompt_setup() {
(( $+VSCODE_PID )) && ZLE_RPROMPT_INDENT=6
fi

# For promptinit
# For promptinit (introduced in Zsh v5.4)
(( ${+functions[prompt_cleanup]} )) &&
prompt_cleanup _agkozak_prompt_cleanup

Expand Down Expand Up @@ -1088,25 +1088,23 @@ prompt_agkozak-zsh-prompt_help() {
# See https://github.com/zdharma/Zsh-100-Commits-Club/blob/master/Zsh-Plugin-Standard.adoc#unload-fun
############################################################
agkozak-zsh-prompt_plugin_unload() {
setopt LOCAL_OPTIONS NO_KSH_ARRAYS NO_SH_WORD_SPLIT
local x

[[ ${AGKOZAK_OLD_OPTIONS[promptsubst]} == 'off' ]] && unsetopt PROMPT_SUBST
[[ ${AGKOZAK_OLD_OPTIONS[promptbang]} == 'on' ]] && setopt PROMPT_BANG

PROMPT=${AGKOZAK[OLD_PROMPT]}
RPROMPT=${AGKOZAK[OLD_RPROMPT]}
PROMPT="${AGKOZAK[OLD_PROMPT]}"
RPROMPT="${AGKOZAK[OLD_RPROMPT]}"

psvar=( $AGKOZAK_OLD_PSVAR )
psvar=( "${AGKOZAK_OLD_PSVAR[@]}" )

add-zsh-hook -D preexec prompt_agkozak_preexec
add-zsh-hook -D precmd prompt_agkozak_precmd

if is-at-least 5.3; then
add-zle-hook-widget -D zle-keymap-select _agkozak_zle-keymap-select
else
# TODO: Make sure this is the right thing to do.
zle -N zle-keymap-select
zle -D zle-keymap-select
fi

for x in ${=AGKOZAK[FUNCTIONS]}; do
Expand All @@ -1121,6 +1119,8 @@ agkozak-zsh-prompt_plugin_unload() {

############################################################
# promptinit cleanup function
#
# prompt_cleanup was introduced in Zsh v5.4
############################################################
_agkozak_prompt_cleanup() {
setopt LOCAL_OPTIONS NO_KSH_ARRAYS NO_SH_WORD_SPLIT
Expand All @@ -1131,7 +1131,7 @@ _agkozak_prompt_cleanup() {
if is-at-least 5.3; then
add-zle-hook-widget -D zle-keymap-select _agkozak_zle-keymap-select
else
zle -D _agkozak_zle-keymap_select
zle -D zle-keymap-select
fi
}

Expand Down

0 comments on commit 4ea022b

Please sign in to comment.