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

Re: completion inside vared



yes that worked (apart from a space to be added between [[and $ funcstack), thanks.
I'm having another annoyance:
when I exit with ctrl-c from 

vared -ehp $prompt text

the history file gets emptied. I tried 
trap 'zle send-break' INT
but it doesn't change the result

Is there something I can do to exit from vared with a key combination (ctrl-d only works if the line is empty) without losing the history?
I could use zle to send the kill-whole-line widget, but how do I send ctrl-d then? Is it possibile with zle to send key combinations?

thanks

Pier Paolo Grassi


Il giorno sab 19 feb 2022 alle ore 00:39 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> ha scritto:
On Fri, Feb 18, 2022 at 3:09 PM Pier Paolo Grassi <pierpaolog@xxxxxxxxx> wrote:
>
> does anyone has some clue as to where I can find how to do this?

Been busy and didn't have a chance to respond before.

The _in_vared completer forces use of _value which calls _default.  A
side-effect of _default is that compctl completions are attempted.

So what you need is:
zstyle ':completion::complete:-value-*:*' use-compctl no

Or if you want it to be specific to vared, something like:
zstyle -e ':completion::complete:-value-*:*' use-compctl '[[
$funcstack = *_in_vared* ]] && reply=no'

which admittedly is a bit convoluted ... _in_vared probably ought to
be doing some style checks of its own rather than pushing everything
down to _value.


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