zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] _zstyle vcs_info completion: Add missing styles
@ 2015-01-24 15:34 Daniel Shahaf
  2015-01-25  0:46 ` Frank Terbeck
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Shahaf @ 2015-01-24 15:34 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 71 bytes --]

Patch that adds a few vcs_info-specific styles to zstyle's completion.

[-- Attachment #2: 0002-_zstyle-vcs_info-completion-Add-missing-styles.patch --]
[-- Type: text/x-patch, Size: 2842 bytes --]

>From 70593fe82ced51aea5783f3f1f8e33ab016143c0 Mon Sep 17 00:00:00 2001
From: Daniel Shahaf <d.s@daniel.shahaf.name>
Date: Sat, 24 Jan 2015 05:39:01 +0000
Subject: [PATCH 2/2] _zstyle vcs_info completion: Add missing styles

---
 Completion/Zsh/Command/_zstyle | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/Completion/Zsh/Command/_zstyle b/Completion/Zsh/Command/_zstyle
index c8e1c2b..2ebae71 100644
--- a/Completion/Zsh/Command/_zstyle
+++ b/Completion/Zsh/Command/_zstyle
@@ -20,6 +20,9 @@ _completers() {
       compadd "$@" "$disp[@]" - "$us${^list[@]}"
 }
 
+_vcs_info_hooks() {
+  compadd - ${functions[(I)+vi-*]#+vi-}
+}
 # Assoc array of styles; the values give the possible top-level
 # contexts:
 #   c   completion
@@ -176,7 +179,10 @@ styles=(
   actionformats          v:vcs-format
   branchformat           v:branch-format
   nvcsformats            v:
+  hgrevformat            v:hgrev-format
   stgitformat            v:stg-format
+  patch-format           v:patch-format
+  nopatch-format         v:patch-format
   max-exports            v:
   enable                 v:vcs
   disable                v:vcs
@@ -190,7 +196,16 @@ styles=(
   use-server             v:bool
   use-simple             v:bool
   get-revision           v:bool
+  get-mq                 v:bool
+  get-bookmarks          v:bool
+  get-unapplied          v:bool
+  debug                  v:bool
+  hooks                  v:_vcs_info_hooks
   use-prompt-escapes     v:bool
+  use-quilt              v:bool
+  quilt-standalone       v:bool
+  quilt-patch-dir        v:_directories
+  quiltcommand           v:_command_names
 
   chpwd			 z:bool
   progress		 z:progress
@@ -555,6 +570,17 @@ while (( $#state )); do
       fi
       ;;
 
+    (hgrev-format)
+      if [[ $PREFIX = *% ]]; then
+        compset -P '*%'
+        _values -s '' 'format replacement' \
+          'h[current revision hash (global)]' \
+          'r[current revision number (local)]'
+      else
+        _message -e formats 'vcs format'
+      fi
+      ;;
+
     (stg-format)
       if [[ $PREFIX = *% ]]; then
         compset -P '*%'
@@ -566,6 +592,22 @@ while (( $#state )); do
       fi
       ;;
 
+    (patch-format)
+      if [[ $PREFIX = *% ]]; then
+        compset -P '*%'
+        _values -s '' 'format replacement' \
+          'p[name of top-most patch (applied-string)]' \
+          'u[number of unapplied patches (unapplied-string)]' \
+          'n[number of applied patches]' \
+          'c[number of unapplied patches.]' \
+          'a[number of all patches]' \
+          'g[names of active mq guards (hg backend)]' \
+          'G[number of active mq guards (hg backend)]'
+      else
+        _message -e formats 'vcs format'
+      fi
+      ;;
+
     (_*)
       ${=state[1]} $suf
       ;;
-- 
1.9.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] _zstyle vcs_info completion: Add missing styles
  2015-01-24 15:34 [PATCH] _zstyle vcs_info completion: Add missing styles Daniel Shahaf
@ 2015-01-25  0:46 ` Frank Terbeck
  0 siblings, 0 replies; 2+ messages in thread
From: Frank Terbeck @ 2015-01-25  0:46 UTC (permalink / raw)
  To: zsh-workers

Daniel Shahaf wrote:
[...]
> From: Daniel Shahaf <d.s@daniel.shahaf.name>
[...]
> Subject: [PATCH 2/2] _zstyle vcs_info completion: Add missing styles
>
> ---
>  Completion/Zsh/Command/_zstyle | 42 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
[...]

Applied, thanks again!


Regards, Frank


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-25  1:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-24 15:34 [PATCH] _zstyle vcs_info completion: Add missing styles Daniel Shahaf
2015-01-25  0:46 ` Frank Terbeck

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).