summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-01-03 18:40:17 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-01-03 18:40:17 +0000
commit76dc71f882d47f057167dff717194687b947aad9 (patch)
treee3f7b932edfbb69765252769d2d2b7cafa2e93f6
parent851663282a3ff6ca39412bd0ab7481b14e66f495 (diff)
downloadzsh-76dc71f882d47f057167dff717194687b947aad9.tar.gz
zsh-76dc71f882d47f057167dff717194687b947aad9.tar.xz
zsh-76dc71f882d47f057167dff717194687b947aad9.zip
Frank Terbeck: 26215: VCS_Info disable-patterns style
-rw-r--r--ChangeLog3
-rw-r--r--Doc/Zsh/contrib.yo10
-rw-r--r--Functions/VCS_Info/vcs_info12
3 files changed, 24 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 2df340165..470f6361f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2009-01-03  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
+	* Frank Terbeck: 26215: Doc/Zsh/contrib.yo,
+	Functions/VCS_Info/vcs_info: disable-patterns style.
+
 	* Greg Klanderman: 26159: Src/Zle/zle_utils.c: CUT_RAW should be
 	CUT_REPLACE for multiple kills to append.
 
diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo
index c393d2895..826fb2070 100644
--- a/Doc/Zsh/contrib.yo
+++ b/Doc/Zsh/contrib.yo
@@ -506,6 +506,16 @@ A list of VCSs, you don't want var(vcs_info) to test for
 repositories (checked in the var(-init-) context, too). Only used if
 tt(enable) contains tt(ALL).
 )
+kindex(disable-patterns)
+item(tt(disable-patterns))(
+A list of patterns that are checked against tt($PWD). If the pattern
+matches, var(vcs_info) will is disabled. This style is checked in the
+var(:vcs_info:-init-:*:-all-) context.
+
+Say, tt(~/.zsh) is a directory under version control, in which you do
+not want var(vcs_info) to be active, do:
+example(zstyle ':vcs_info:*' disable-patterns "$HOME/.zsh+LPAR()|/*+RPAR()")
+)
 kindex(command)
 item(tt(command))(
 This style causes var(vcs_info) to use the supplied string as the command
diff --git a/Functions/VCS_Info/vcs_info b/Functions/VCS_Info/vcs_info
index 7ecd1224a..a821e4d03 100644
--- a/Functions/VCS_Info/vcs_info
+++ b/Functions/VCS_Info/vcs_info
@@ -41,8 +41,9 @@ vcs_info () {
     emulate -L zsh
     setopt extendedglob
 
+    local pat
     local -i found
-    local -a enabled disabled
+    local -a enabled disabled dps
     local -x usercontext vcs rrn
     local -ix maxexports
     local -ax msgs
@@ -64,6 +65,15 @@ vcs_info () {
         zstyle -a ":vcs_info:${vcs}:${usercontext}:${rrn}" "disable" disabled
     fi
 
+    zstyle -a ":vcs_info:${vcs}:${usercontext}:${rrn}" "disable-patterns" dps
+
+    for pat in ${dps} ; do
+        if [[ ${PWD} == ${~pat} ]] ; then
+            [[ -n ${vcs_info_msg_0_} ]] && VCS_INFO_set --clear
+            return 0
+        fi
+    done
+
     VCS_INFO_maxexports
 
     (( found = 0 ))