zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: compadd -Q -U completes $(( without inserting upon it
Date: Sat, 16 Jan 2016 18:25:14 +0100	[thread overview]
Message-ID: <CAKc7PVAGtkxB=QU8W_Uvy7msDqh82W-q78Cwp4uqW0op-VztxA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 902 bytes --]

Hello,
I have two completers, first one:

PREFIX='open'
SUFFIX=''
IPREFIX=""
ISUFFIX=""
words=( 'open' )
builtin compadd -Q -U 'open 0 + 1 close'

second one:
PREFIX='$(('
SUFFIX=''
IPREFIX=""
ISUFFIX=""
words=( '$((' )
builtin compadd -Q -U '$(( 0 + 1 ))'

With first one, if I do "open<TAB>", I get: "open 0 + 1 close". With
second one, when I do "$((<TAB>", I get "$(($(( 0 + 1 ))'.

This looks like zsh source has embedded tweaks to make math
($compstate[context] is "math" in second case) completing work more
reasonably. Is there a way to overcome this?

Video:
https://asciinema.org/a/9o1wwp76t0z2j2fz15aoucwym

To test the attached files:

autoload compadd_test ; zle -N compadd_test
autoload compadd_test2 ; zle -N compadd_test2

then:

zstyle ':completion:*' completer compadd_test _complete

or:

zstyle ':completion:*' completer compadd_test2 _complete

Best regards,
Sebastian Gniazdowski

[-- Attachment #2: compadd_test --]
[-- Type: application/octet-stream, Size: 119 bytes --]

PREFIX='open'
SUFFIX=''
IPREFIX=""
ISUFFIX=""
words=( 'open' )

builtin compadd -Q -U 'open 0 + 1 close'

# vim:ft=zsh

[-- Attachment #3: compadd_test2 --]
[-- Type: application/octet-stream, Size: 113 bytes --]

PREFIX='$(('
SUFFIX=''
IPREFIX=""
ISUFFIX=""
words=( '$((' )

builtin compadd -Q -U '$(( 0 + 1 ))'

# vim:ft=zsh

             reply	other threads:[~2016-01-16 17:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-16 17:25 Sebastian Gniazdowski [this message]
2016-01-16 22:55 ` Bart Schaefer
2016-01-17 15:21   ` Sebastian Gniazdowski

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='CAKc7PVAGtkxB=QU8W_Uvy7msDqh82W-q78Cwp4uqW0op-VztxA@mail.gmail.com' \
    --to=sgniazdowski@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).