Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Proposal: Let compinit make standard widgets with _generic instead of _main_complete
- X-seq: zsh-workers 48194
- From: Marlon Richert <marlon.richert@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Proposal: Let compinit make standard widgets with _generic instead of _main_complete
- Date: Sat, 20 Mar 2021 00:23:53 +0200
- Archived-at: <https://zsh.org/workers/48194>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-03/CAHLkEDuxX39Z7-ioZTgrosL-SQW8dhZy9_v694u7w4Mtu%2BEHSw%40mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
How would you feel about changing compinit, so that it rebinds the
standard widgets with `zle -C $_i_line .$_i_line _generic` instead of
`zle -C $_i_line .$_i_line _main_complete`?
(https://github.com/zsh-users/zsh/blob/f4a248f9d38dc02d65610395f4c7f9a95a5d6612/Completion/compinit#L558)
This would make it easier for the end user to define, for example,
different `menu` styles for different widgets. Without using
`_generic`, the end user cannot out-of-the-box define different styles
for different widgets.
Here's the patch:
diff --git Completion/compinit Completion/compinit
index e81cd1604..212bc7cf3 100644
--- Completion/compinit
+++ Completion/compinit
@@ -555,9 +555,9 @@ fi
for _i_line in complete-word delete-char-or-list expand-or-complete \
expand-or-complete-prefix list-choices menu-complete \
menu-expand-or-complete reverse-menu-complete; do
- zle -C $_i_line .$_i_line _main_complete
+ zle -C $_i_line .$_i_line _generic
done
-zle -la menu-select && zle -C menu-select .menu-select _main_complete
+zle -la menu-select && zle -C menu-select .menu-select _generic
# If the default completer set includes _expand, and tab is bound
# to expand-or-complete, rebind it to complete-word instead.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author