summary refs log tree commit diff
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2010-08-10 17:13:42 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2010-08-10 17:13:42 +0000
commitd2e3b6eb62df229ab1af9e1f260a67516712d88d (patch)
tree1f87fa4ff0cfdd9472ad41339ad9719f7c2478ba /Completion/Unix/Command
parenta9e7fd4e757924dd11279fba5c7808aac6c1df59 (diff)
downloadzsh-d2e3b6eb62df229ab1af9e1f260a67516712d88d.tar.gz
zsh-d2e3b6eb62df229ab1af9e1f260a67516712d88d.tar.xz
zsh-d2e3b6eb62df229ab1af9e1f260a67516712d88d.zip
unposted: further update to _todo.sh
also I forgot to commit the previous one
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r--Completion/Unix/Command/_todo.sh16
1 files changed, 8 insertions, 8 deletions
diff --git a/Completion/Unix/Command/_todo.sh b/Completion/Unix/Command/_todo.sh
index 799be5427..0b8b95d2c 100644
--- a/Completion/Unix/Command/_todo.sh
+++ b/Completion/Unix/Command/_todo.sh
@@ -6,9 +6,9 @@
 #  - "replace" will complete the original text for editing
 #  - completing priorities will cycle through A to Z (even without
 #    menu completion)
-#  - list and listall will complete p:<project> and @<where> from
+#  - list and listall will complete +<project> and @<where> from
 #    values in existing entries
-#  - will complete after p: and @ if typed in message text
+#  - will complete after + and @ if typed in message text
 
 setopt localoptions braceccl
 
@@ -53,7 +53,7 @@ case $state in
   case $words[NORMARG] in
     (append|del|do|prepend|pri|replace)
     if (( NORMARG == CURRENT - 1 )); then
-      itemlist=(${${(M)${(f)"$(todo.sh -p list)"}##<-> *}/(#b)(<->) (*)/${match[1]}:${match[2]}})
+      itemlist=(${${(M)${(f)"$(todo.sh -p list | sed '/^--/,$d')"}##<-> *}/(#b)(<->) (*)/${match[1]}:${match[2]}})
       _describe -t todo-items 'todo item' itemlist
     else
       case $words[NORMARG] in
@@ -64,7 +64,7 @@ case $state in
 	nextstate=proj
 	;;
 	(replace)
-	compadd -Q -- "${(qq)$(todo.sh -p list "^0*${words[CURRENT-1]} ")##<-> }"
+	compadd -Q -- "${(qq)$(todo.sh -p list "^[ 0]*${words[CURRENT-1]} " | sed '/^--/,$d')##<-> (\([A-Z]\) |)}"
 	;;
       esac
     fi
@@ -102,15 +102,15 @@ case $nextstate in
   ;;
 
   (proj)
-  # This completes stuff beginning with p: (projects) or @ (contexts);
+  # This completes stuff beginning with + (projects) or @ (contexts);
   # these are todo.sh conventions.
-  if [[ ! -prefix p: && ! -prefix @ ]]; then
+  if [[ ! -prefix + && ! -prefix @ ]]; then
     projmsg=$txtmsg
   fi
   # In case there are quotes, ignore anything up to whitespace before
-  # the p: or @ (which may not even be there yet).
+  # the + or @ (which may not even be there yet).
   compset -P '*[[:space:]]'
   _wanted search expl $projmsg \
-    compadd ${${=${${(M)${(f)"$(todo.sh -p list)"}##<-> *}##<-> }}:#^(p:*|@*)}
+    compadd $(todo.sh lsprj) $(todo.sh lsc)
   ;;
 esac