From eb46727d3a03f2282e811664eee68c7e581c3277 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Wed, 30 Mar 2011 21:24:42 +0000 Subject: 28959: Make the nvcsformats style be used if vcs_info is disabled. --- ChangeLog | 6 +++++- Doc/Zsh/contrib.yo | 10 +++++----- Functions/VCS_Info/VCS_INFO_set | 5 ----- Functions/VCS_Info/vcs_info | 5 +++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6c70d1acf..5368f0a18 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,10 @@ * 28961: Doc/Zsh/contrib.yo, Functions/VCS_Info/VCS_INFO_set: Add `no-vcs' hook. + * 28959: Doc/Zsh/contrib.yo, Functions/VCS_Info/VCS_INFO_set, + Functions/VCS_Info/vcs_info: Make the nvcsformats style be used if + vcs_info is disabled. + 2011-03-29 Mikael Magnusson * unposted: Completion/Unix/Command/_vim: Fix typo in @@ -14410,5 +14414,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5238 $ +* $Revision: 1.5239 $ ***************************************************** diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index bc4a814a5..476e7ca31 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -756,11 +756,11 @@ revision number. This style lets you modify how that string should look. ) kindex(nvcsformats) item(tt(nvcsformats))( -These "formats" are exported when we didn't detect -a version control system for the current directory. This is useful if you -want var(vcs_info) to completely take over the generation of your prompt. -You would do something like tt(PS1='${vcs_info_msg_0_}') to accomplish -that. +These "formats" are exported when we didn't detect a version control system +for the current directory or var(vcs_info) was disabled. This is useful if +you want var(vcs_info) to completely take over the generation of your +prompt. You would do something like tt(PS1='${vcs_info_msg_0_}') to +accomplish that. ) kindex(hgrevformat) item(tt(hgrevformat))( diff --git a/Functions/VCS_Info/VCS_INFO_set b/Functions/VCS_Info/VCS_INFO_set index 23dc06b4b..5087be43f 100644 --- a/Functions/VCS_Info/VCS_INFO_set +++ b/Functions/VCS_Info/VCS_INFO_set @@ -5,11 +5,6 @@ setopt localoptions noksharrays NO_shwordsplit local -i i j -if [[ $1 == '--clear' ]] ; then - for i in {0..9} ; do - unset vcs_info_msg_${i}_ - done -fi if [[ $1 == '--nvcs' ]] ; then [[ $2 == '-preinit-' ]] && (( maxexports == 0 )) && (( maxexports = 1 )) for i in {0..$((maxexports - 1))} ; do diff --git a/Functions/VCS_Info/vcs_info b/Functions/VCS_Info/vcs_info index 385a451da..513489b70 100644 --- a/Functions/VCS_Info/vcs_info +++ b/Functions/VCS_Info/vcs_info @@ -37,6 +37,7 @@ for func in ${static_functions} ; do autoload -Uz ${func} done +[[ -n ${(Mk)parameters:#vcs_info_msg_<->_} ]] && unset ${parameters[(I)vcs_info_msg_<->_]} VCS_INFO_set --nvcs '-preinit-' vcs_info_setsys @@ -77,7 +78,7 @@ vcs_info () { (( ${#enabled} == 0 )) && enabled=( all ) if [[ -n ${(M)enabled:#(#i)none} ]] ; then - [[ -n ${vcs_info_msg_0_} ]] && VCS_INFO_set --clear + [[ -n ${vcs_info_msg_0_} ]] && VCS_INFO_set --nvcs return 0 fi @@ -90,7 +91,7 @@ vcs_info () { for pat in ${dps} ; do if [[ ${PWD} == ${~pat} ]] ; then - [[ -n ${vcs_info_msg_0_} ]] && VCS_INFO_set --clear + [[ -n ${vcs_info_msg_0_} ]] && VCS_INFO_set --nvcs return 0 fi done -- cgit 1.4.1