about summary refs log tree commit diff
path: root/Completion/Base
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2003-07-21 17:01:34 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2003-07-21 17:01:34 +0000
commit48205cc72ff7ce3a1470226ae508e5194252db4e (patch)
tree2726d7ddc7ac72cdf7988dc490afcdfa7852d1e7 /Completion/Base
parent7209f6be5a34cfe936a3d14b0bd61a468e830838 (diff)
downloadzsh-48205cc72ff7ce3a1470226ae508e5194252db4e.tar.gz
zsh-48205cc72ff7ce3a1470226ae508e5194252db4e.tar.xz
zsh-48205cc72ff7ce3a1470226ae508e5194252db4e.zip
18859: Allow the sort style to override sorting by setting explicitly to false.
Diffstat (limited to 'Completion/Base')
-rw-r--r--Completion/Base/Core/_description14
1 files changed, 13 insertions, 1 deletions
diff --git a/Completion/Base/Core/_description b/Completion/Base/Core/_description
index 41f4f2483..573bfbc3d 100644
--- a/Completion/Base/Core/_description
+++ b/Completion/Base/Core/_description
@@ -1,6 +1,6 @@
 #autoload
 
-local name gropt nopt xopt format gname hidden hide match opts tag
+local name gropt nopt xopt format gname hidden hide match opts tag sort
 
 opts=()
 
@@ -31,6 +31,18 @@ zstyle -s ":completion:${curcontext}:$1" matcher match &&
     opts=($opts -M "$match")
 [[ -n "$_matcher" ]] && opts=($opts -M "$_matcher")
 
+# Use sort style, but ignore `menu' value to help _expand.
+# Also don't override explicit use of -V.
+if { zstyle -s ":completion:${curcontext}:$1" sort sort ||
+     zstyle -s ":completion:${curcontext}:" sort sort; } &&
+    [[ "$gropt" = -J && $sort != menu ]]; then
+    if [[ "$sort" = (yes|true|1|on) ]]; then
+	gropt=(-J)
+    else
+	gropt=(-V)
+    fi
+fi
+
 if [[ -z "$_comp_no_ignore" ]]; then
   zstyle -a ":completion:${curcontext}:$1" ignored-patterns _comp_ignore ||
     _comp_ignore=()