From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28409 invoked by alias); 30 Mar 2011 20:52:55 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28959 Received: (qmail 7155 invoked from network); 30 Mar 2011 20:52:54 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at bewatermyfriend.org does not designate permitted sender hosts) From: Frank Terbeck To: zsh-workers@zsh.org Subject: PATCH: (4/4) vcs_info: nvcsformats style should be used if the system is disabled Date: Wed, 30 Mar 2011 22:37:16 +0200 Message-Id: <1301517436-11451-5-git-send-email-ft@bewatermyfriend.org> X-Mailer: git-send-email 1.7.4.1.140.g89781 In-Reply-To: <1301517436-11451-1-git-send-email-ft@bewatermyfriend.org> References: <1301517436-11451-1-git-send-email-ft@bewatermyfriend.org> X-Df-Sender: 430444 I was actually wondering, that this was not the case yet... --- Doc/Zsh/contrib.yo | 10 +++++----- Functions/VCS_Info/VCS_INFO_set | 5 ----- Functions/VCS_Info/vcs_info | 5 +++-- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index bc4a814..476e7ca 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 23dc06b..5087be4 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 385a451..513489b 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 -- 1.7.4.1.140.g89781