mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-05-20 11:31:28 +02:00
github #102: Ensure todo.sh completion uses builtin commands
the `todo.sh` script allows redefining commands locally, which can mess up this completion script. We are using the `command` subcommand to avoid that.
This commit is contained in:
parent
f36fccbb84
commit
97e4310563
2 changed files with 8 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
|||
2023-10-29 Matthew Martin <phy1729@gmail.com>
|
||||
|
||||
* github #102: Ulysse Buonomo: Completion/Unix/Command/_todo.sh:
|
||||
Ensure todo.sh completion uses builtin commands
|
||||
|
||||
2023-10-25 Bart Schaefer <schaefer@zsh.org>
|
||||
|
||||
* Daniel Shahaf: 50569 (tweaked): main keymap defaults to emacs
|
||||
|
|
|
@ -97,7 +97,7 @@ case $state in
|
|||
;;
|
||||
(replace)
|
||||
item=${words[CURRENT-1]##0##}
|
||||
compadd -Q -- "${(qq)$(todo.sh -p list "^[ 0]*$item " | sed '/^--/,$d')##<-> (\([A-Z]\) |)}"
|
||||
compadd -Q -- "${(qq)$(todo.sh -p command list "^[ 0]*$item " | sed '/^--/,$d')##<-> (\([A-Z]\) |)}"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
@ -144,7 +144,7 @@ case $nextstate in
|
|||
;;
|
||||
|
||||
(item)
|
||||
itemlist=(${${(M)${(f)"$(todo.sh -p list | sed '/^--/,$d')"}##<-> *}/(#b)(<->) (*)/${match[1]}:${match[2]}})
|
||||
itemlist=(${${(M)${(f)"$(todo.sh -p command list | sed '/^--/,$d')"}##<-> *}/(#b)(<->) (*)/${match[1]}:${match[2]}})
|
||||
_describe -t todo-items 'todo item' itemlist
|
||||
;;
|
||||
|
||||
|
@ -173,6 +173,6 @@ case $nextstate in
|
|||
# the + or @ (which may not even be there yet).
|
||||
compset -P '*[[:space:]]'
|
||||
_wanted search expl $projmsg \
|
||||
compadd $(todo.sh lsprj) $(todo.sh lsc)
|
||||
compadd $(todo.sh command listproj) $(todo.sh command listcon)
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Reference in a new issue