about summary refs log tree commit diff
path: root/Completion/Base/Core
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Base/Core')
-rw-r--r--Completion/Base/Core/_description15
-rw-r--r--Completion/Base/Core/_main_complete2
-rw-r--r--Completion/Base/Core/_message13
3 files changed, 28 insertions, 2 deletions
diff --git a/Completion/Base/Core/_description b/Completion/Base/Core/_description
index 6b4cadfe8..30e6dfa9b 100644
--- a/Completion/Base/Core/_description
+++ b/Completion/Base/Core/_description
@@ -1,6 +1,6 @@
 #autoload
 
-local name gropt=-J format gname hidden hide match opts
+local name gropt=-J format gname hidden hide match opts tag
 
 opts=()
 
@@ -51,6 +51,8 @@ else
   _comp_ignore=()
 fi
 
+tag="$1"
+
 shift 2
 if [[ -z "$1" && $# -eq 1 ]]; then
   format=
@@ -72,4 +74,15 @@ else
   fi
 fi
 
+if ! (( ${funcstack[2,-1][(I)_description]} )) &&
+   zstyle -a ":completion:${curcontext}:$tag" fake match; then
+
+  local descr
+
+  descr=( "${(@M)match:#*[^\\]:*}" )
+
+  compadd "${(@P)name}" - "${(@)${(@)match:#*[^\\]:*}:s/\\:/:/}"
+  (( $#descr )) && _describe -t "$tag" '' descr "${(@P)name}"
+fi
+
 return 0
diff --git a/Completion/Base/Core/_main_complete b/Completion/Base/Core/_main_complete
index 5960b2da7..f3ad720c9 100644
--- a/Completion/Base/Core/_main_complete
+++ b/Completion/Base/Core/_main_complete
@@ -268,7 +268,7 @@ if [[ $compstate[old_list] = keep || nm -gt 1 ]]; then
       fi
     fi
   fi
-elif [[ nm -le 1 && -n "$_comp_mesg" ]]; then
+elif [[ nm -lt 1 && -n "$_comp_mesg" ]]; then
   compstate[insert]=''
   compstate[list]='list force'
 elif [[ nm -eq 0 && -z "$_comp_mesg" &&
diff --git a/Completion/Base/Core/_message b/Completion/Base/Core/_message
index cd08d5fb0..44512f648 100644
--- a/Completion/Base/Core/_message
+++ b/Completion/Base/Core/_message
@@ -2,6 +2,19 @@
 
 local format raw
 
+if [[ "$1" = -e ]]; then
+  local expl ret=1
+
+  _comp_mesg=yes
+
+  _tags "$2" && while _next_label "$2" expl "$3"; do
+    compadd ${expl:/-X/-x}
+    ret=0
+  done
+
+  return ret
+fi
+
 _tags messages || return 1
 
 if [[ "$1" = -r ]]; then