Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: (4/4) vcs_info: nvcsformats style should be used if the system is disabled



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



Messages sorted by: Reverse Date, Date, Thread, Author