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

Issue with insert-sections style



Hi there,

I discovered an issue with the insert-sections style for manual
pages (which, by the way, is not documented anywhere).

If you use the _oldlist completer together with the no_list_ambiguous
option the following bug occurs: When you have entered a man page name
with a prefix that can only be expanded to man pages from one section,
that section number gets inserted when drawing the listing, and then
*again* when the user enters menu completion.

Provided below is a minimal zshrc to reproduce the bug. An example
which will work on most systems might be "man pam_li<Tab><Tab>":

  # minimal setup
  autoload -U compinit && compinit
  zmodload -i zsh/complist
  bindkey '^i' complete-word
  zstyle ':completion:*' menu select # if you like
  zstyle ':completion:*' group-name ''
  zstyle ':completion:*:descriptions' format 'completing %B%d%b'
  zstyle ':completion:*:manuals' separate-sections true

  # make insertion possible
  setopt extendedglob
  zstyle ':completion:*:manuals.(^1*)' insert-sections true

  # cause double-insertion
  zstyle ':completion:*' completer _oldlist _complete
  setopt nolistambiguous

Cheers,
Julius



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