Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: RE: About the new long/short options changes



I wrote:

> ...
> 
> And since I had to fiddle with this anyway, I also added the
> `list-separator' style to make the separator string configurable.  Peter
> can now set that to `#' (spaces are added automatically).

I knew that couldn't be all places...


Btw, I use list-colors to make the separator less visible:

  zstyle ':completion:*:(jobs|directory-stack|indexes)' list-colors \
    '=(#b)(*)-- (*)=35;1=31;1=33;1'
  zstyle ':completion:*:(options|values)' list-colors \
    '=(#b)(*)-- (*)=35;1=31;1=33;1' '=*=31;1'

(You'll get different and probably very ugly colors with this, for me
`35' is a light grey.)


Bye
  Sven

Index: Completion/Unix/Command/_lzop
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_lzop,v
retrieving revision 1.1
diff -u -r1.1 _lzop
--- Completion/Unix/Command/_lzop	2001/04/02 11:56:31	1.1
+++ Completion/Unix/Command/_lzop	2001/07/25 12:34:59
@@ -1,6 +1,6 @@
 #compdef lzop
 
-local expl state line decompress disp curcontext="$curcontext"
+local expl state line decompress disp curcontext="$curcontext" sep
 typeset -A opt_args
 
 _arguments -C -s \
@@ -91,12 +91,13 @@
     fi
   ;;
   flags)
+    zstyle -s ":completion:${curcontext}:flags" list-separator sep || sep=--
     disp=( \
-      "F -- Append a \`*' for executable files" \
-      "G -- Inhibit display of group information" \
-      "Q -- Enclose file names in double quotes" )
-    disp=( ${disp[@]%[Z$PREFIX] -*} )
+      "F $sep Append a \`*' for executable files" \
+      "G $sep Inhibit display of group information" \
+      "Q $sep Enclose file names in double quotes" )
+    disp=( ${disp[@]:#[Z$PREFIX]*} )
     compset -P '[FGQ]*'
-    compadd -d disp - ${disp[@]% -*}
+    compadd -d disp - ${disp[@]%% *}
   ;;
 esac
Index: Completion/Zsh/Type/_directory_stack
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Type/_directory_stack,v
retrieving revision 1.4
diff -u -r1.4 _directory_stack
--- Completion/Zsh/Type/_directory_stack	2001/04/17 09:12:27	1.4
+++ Completion/Zsh/Type/_directory_stack	2001/07/25 12:35:01
@@ -7,11 +7,13 @@
 
 setopt localoptions nonomatch
 
-local expl list lines revlines disp
+local expl list lines revlines disp sep
 
 ### we decided against this, for now...
 #! zstyle -T ":completion:${curcontext}:directory-stack" prefix-needed ||
 
+zstyle -s ":completion:${curcontext}:directory-stack" list-separator sep || sep=--
+
 [[ $PREFIX = [-+]* ]] || return 1
 
 if zstyle -T ":completion:${curcontext}:directory-stack" verbose; then
@@ -24,11 +26,11 @@
     integer i
     revlines=( $lines )
     for (( i = 1; i <= $#lines; i++ )); do
-      lines[$i]="$((i-1)) -- ${revlines[-$i]##[0-9]#[	 ]#}"
+      lines[$i]="$((i-1)) $sep ${revlines[-$i]##[0-9]#[	 ]#}"
     done
   else
     for (( i = 1; i <= $#lines; i++ )); do
-      lines[$i]="$i -- ${lines[$i]##[0-9]#[	 ]#}"
+      lines[$i]="$i $sep ${lines[$i]##[0-9]#[	 ]#}"
     done
   fi
   # get the array of numbers only
Index: Completion/Zsh/Type/_file_descriptors
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Type/_file_descriptors,v
retrieving revision 1.1
diff -u -r1.1 _file_descriptors
--- Completion/Zsh/Type/_file_descriptors	2001/04/02 11:19:30	1.1
+++ Completion/Zsh/Type/_file_descriptors	2001/07/25 12:35:01
@@ -1,20 +1,22 @@
 #autoload
 
-local i fds expl list link
+local i fds expl list link sep
 
 for i in {0..9}; [[ -e /dev/fd/$i ]] && fds=( ${fds[@]} $i )
 
-if zstyle -T ":completion:${curcontext}" verbose && [[ -e /proc/$$/fd ]]; then
+if zstyle -T ":completion:${curcontext}:" verbose && [[ -e /proc/$$/fd ]]; then
+  zstyle -s ":completion:${curcontext}:" list-separator sep || sep=--
+
   if zmodload -e zsh/stat; then
     for i in "${fds[@]}"; do
       stat +link -A link /proc/$$/fd/$i
-      list=( ${list[@]} "$i -- ${link[1]}" )
+      list=( ${list[@]} "$i $sep ${link[1]}" )
     done
   elif (( $+commands[readlink] )); then
-    for i in "${fds[@]}"; list=( ${list[@]} "$i -- $(readlink /proc/$$/fd/$i)" )
+    for i in "${fds[@]}"; list=( ${list[@]} "$i $sep $(readlink /proc/$$/fd/$i)" )
   else
     for i in "${fds[@]}"; do
-      list=( ${list[@]} "$i -- $(ls -l /proc/$$/fd/$i|sed 's/.*-> //' )" )
+      list=( ${list[@]} "$i $sep $(ls -l /proc/$$/fd/$i|sed 's/.*-> //' )" )
     done
   fi
   _wanted file-descriptors expl 'file descriptors' compadd "$@" -d list -a fds
Index: Completion/Zsh/Type/_jobs
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Type/_jobs,v
retrieving revision 1.1
diff -u -r1.1 _jobs
--- Completion/Zsh/Type/_jobs	2001/04/02 11:17:48	1.1
+++ Completion/Zsh/Type/_jobs	2001/07/25 12:35:04
@@ -1,6 +1,6 @@
 #autoload
 
-local expl disp jobs job jids pfx='%' desc how expls
+local expl disp jobs job jids pfx='%' desc how expls sep
 
 if [[ "$1" = -t ]]; then
   zstyle -T ":completion:${curcontext}:jobs" prefix-needed &&
@@ -26,9 +26,10 @@
 
 if [[ -n "$desc" ]]; then
   disp=()
+  zstyle -s ":completion:${curcontext}:jobs" list-separator sep || sep=--
   for job in "$jids[@]"; do
     [[ -n "$desc" ]] &&
-        disp=( "$disp[@]" "${pfx}${(r:2:: :)job} -- ${(r:COLUMNS-8:: :)jobtexts[$job]}" )
+        disp=( "$disp[@]" "${pfx}${(r:2:: :)job} $sep ${(r:COLUMNS-8:: :)jobtexts[$job]}" )
   done
 fi
 

-- 
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author