zsh-users
 help / color / mirror / code / Atom feed
From: Omari Norman <omari@smileystation.com>
To: zsh-users@zsh.org
Subject: _next_tags doesn't cycle?
Date: Tue, 25 May 2021 10:44:39 -0400	[thread overview]
Message-ID: <26622A4B-7063-464A-A2D6-AB7F17EC1DE5@smileystation.com> (raw)

Hello,

I’m trying to better understand the completion system by building some primitive completions and seeing what they do.  It seems to me _next_tags doesn’t cycle through tags as I’d expect and I’m wondering what I’m doing wrong.

So I have this in a file named _zeke in my fpath:

#compdef zeke

local ret=1
_tags foo bar baz
while _tags; do
  if _requested bar; then
    compadd heres_bar
    ret=0
  fi
  if _requested foo; then
    compadd heres_foo
    ret=0
  fi
  if _requested baz; then
    compadd heres_baz
    ret=0
  fi
  [[ $ret -eq 0 ]] && break
done
return ret

and in my shell I do

zstyle ':completion::complete:zeke::' tag-order foo bar baz

So, I would think that in my shell if I type “zeke” followed by a space, then ctrl-D to bring up a list of completions, then "ctrl-X n” to invoke _next_tags, it would cycle through “heres_foo”, “heres_bar”, and “heres_baz”.  But I get no cycling.  Instead all I get is the completion for “heres_foo” with no change when I press “ctrl-X n”.

Thanks for any help!  —Omari

                 reply	other threads:[~2021-05-25 14:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=26622A4B-7063-464A-A2D6-AB7F17EC1DE5@smileystation.com \
    --to=omari@smileystation.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).