1
0
Fork 0

Avoid double-assignment of _prompt_giddie_symbol by using different hooks

pull/492/head
Paul Gideon Dann 11 years ago
parent fd9d3e7bf0
commit 53bba522dc

@ -21,7 +21,7 @@ function +vi-set_vcs_prompt_symbol() {
function +vi-set_novcs_prompt_symbol() {
_prompt_giddie_symbol=')'
}
function +vi-set_extra_prompt_data() {
function +vi-set_extra_git_prompt_data() {
# Check for untracked files, since vcs_info does not.
if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then
hook_com[unstaged]+='%F{green}?%f'
@ -41,6 +41,7 @@ function prompt_giddie_setup {
# Load required functions.
autoload -Uz vcs_info
autoload -Uz vcs_info_hookadd
autoload -Uz add-zsh-hook
# Add hook to set up prompt parameters before each command.
@ -59,9 +60,9 @@ function prompt_giddie_setup {
zstyle ':vcs_info:*' unstagedstr '%F{green}!%f'
# Add vcs_info hooks
zstyle ':vcs_info:*+start-up:*' hooks set_vcs_prompt_symbol
zstyle ':vcs_info:*+no-vcs:*' hooks set_novcs_prompt_symbol
zstyle ':vcs_info:git*+set-message:*' hooks set_extra_prompt_data
vcs_info_hookadd 'no-vcs' set_novcs_prompt_symbol
vcs_info_hookadd 'set-message' set_vcs_prompt_symbol
zstyle ':vcs_info:git*+set-message:*' hooks set_extra_git_prompt_data
# Define prompts.
PROMPT='%(?..%F{red}%B-> [%?]%b%f

Loading…
Cancel
Save