about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Base/Utility/_describe8
-rw-r--r--Completion/Zsh/Command/_zstyle5
2 files changed, 10 insertions, 3 deletions
diff --git a/Completion/Base/Utility/_describe b/Completion/Base/Utility/_describe
index b215b6279..0a291302b 100644
--- a/Completion/Base/Utility/_describe
+++ b/Completion/Base/Utility/_describe
@@ -2,7 +2,7 @@
 
 # This can be used to add options or values with descriptions as matches.
 
-local _opt _expl _tmpm _tmpd
+local _opt _expl _tmpm _tmpd _mlen
 local _type=values _descr _ret=1 _showd _nm _hide _args _grp _sep
 local csl="$compstate[list]" csl2
 local _oargv _argv _new _strs _mats _opts _i _try=0
@@ -25,6 +25,8 @@ fi
 zstyle -T ":completion:${curcontext}:$_type" verbose && _showd=yes
 
 zstyle -s ":completion:${curcontext}:$_type" list-separator _sep || _sep=--
+zstyle -s ":completion:${curcontext}:$_type" max-match-length _mlen ||
+    _mlen=$((COLUMNS/2))
 
 _descr="$1"
 shift
@@ -97,9 +99,9 @@ while _tags; do
     fi
 
     if [[ -n "$_showd" ]]; then
-      compdescribe -I "$_hide" "$_sep " _expl "$_grp[@]" "$@"
+      compdescribe -I "$_hide" "$_mlen" "$_sep " _expl "$_grp[@]" "$@"
     else
-      compdescribe -i "$_hide" "$@"
+      compdescribe -i "$_hide" "$_mlen" "$@"
     fi
 
     compstate[list]="$csl"
diff --git a/Completion/Zsh/Command/_zstyle b/Completion/Zsh/Command/_zstyle
index 99ee8f72b..db4d6604b 100644
--- a/Completion/Zsh/Command/_zstyle
+++ b/Completion/Zsh/Command/_zstyle
@@ -80,6 +80,7 @@ styles=(
   matcher		 c:
   matcher-list		 c:
   max-errors		 c:
+  max-match-length       c:max-match-length
   menu			 c:boolauto
   muttrc                 c:_files
   numbers		 c:bool
@@ -382,6 +383,10 @@ while (( $#state )); do
       _message -e separators 'separator string'
       ;;
 
+    max-match-length)
+      _message -e numbers 'maximum display length for matches'
+      ;;
+
     urgh) 
       _wanted values expl no compadd no false off 0
       ;;