From: Marlon Richert <marlon.richert@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Bug report: Completion for dynamically named dirs fails when $SUFFIX is not empty
Date: Thu, 21 Jan 2021 16:37:24 +0200 [thread overview]
Message-ID: <CAHLkEDsban8XbhMmn4nHHWAN2sxMS+b5vANamu-41Cr2zghRwA@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 723 bytes --]
% cd $(mktemp -d)
% ZDOTDIR=$PWD HOME=$PWD zsh -f
% autoload -Uz compinit
% compinit
% zsh_directory_name() { [[ $1 == c ]] && compadd -S ']' foo }
Given the above setup, when
1. $LBUFFER is `cd ~[` or `cd ~[fo`,
2. $RBUFFER is empty, and
3. I press ^I,
4. then $LBUFFER becomes `cd ~[foo]`.
1. $LBUFFER is `cd ~[`,
2. $RBUFFER is `fo` or `]`, and
3. I press ^I,
4. then completion beeps and the buffer remains unchanged.
`functions -t _complete` shows that the problem is caused by
$compstate[context] becoming `tilde` instead of `subscript` as soon as
$SUFFIX is non-empty, which causes _complete() to not call _subscript(),
which is the only point of entry to _dynamic_directory_name().
[-- Attachment #2: Type: text/html, Size: 2739 bytes --]
next reply other threads:[~2021-01-21 14:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-21 14:37 Marlon Richert [this message]
2021-01-25 15:07 ` Peter Stephenson
2021-03-31 8:10 ` Marlon Richert
2021-03-31 8:25 ` Peter Stephenson
2021-03-31 8:29 ` Marlon Richert
2021-03-31 8:37 ` Marlon Richert
2021-03-31 8:56 ` Peter Stephenson
2021-05-07 14:08 ` [BUG] COMPLETE_IN_WORD fails to recognize brace_parameter context Marlon Richert
2021-05-08 0:04 ` Bart Schaefer
2021-05-08 13:04 ` Marlon Richert
2021-05-08 4:37 ` Bart Schaefer
2023-02-22 11:55 ` Bug report: Completion for dynamically named dirs fails when $SUFFIX is not empty Marlon Richert
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=CAHLkEDsban8XbhMmn4nHHWAN2sxMS+b5vANamu-41Cr2zghRwA@mail.gmail.com \
--to=marlon.richert@gmail.com \
--cc=zsh-workers@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).