Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Asynchronous completions?
- X-seq: zsh-workers 44401
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- Subject: Re: Asynchronous completions?
- Date: Wed, 5 Jun 2019 09:57:14 +0200
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=PtgJWuAWMv2tVDvnKXJzk5c216mS5QrZHoHZA3NOWrU=; b=e9kZeC3Z77nuzKyW/E2589u80TzMfaW3S4zfpnSlRDX2GyiMwthuBCTX5ubB3P0Mm9 ChDY6du7t0mQKdNRO3UwjopZ3WTEIyNb7j0tTlY5RnPyWLtLMD9Iwxyk1GCeBitC2dyf 1cFMzzySFGJSYb46hl1K2gfDqstt9c/9kQJ+VnOxfY0FymQHYWIMTy3JqzfnC1JHcl9C qG+SXHrHOoWg8xwPHhfnsK41Sma1bkzWfbaIW+3RFIJ7sj1K/UIR3wXGsZPdEuHuJgOz 415hvgQkUtnMgKirv987LD4q74ZGbJFSi9DRvTP3Nt3U8X2h/VUP73xrpXqIpgF62nBy EEug==
- In-reply-to: <CAKc7PVA-342v=iFVk5dR5fOZ+2N3iEQQU9dOzYHycwuUWUi3mA@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVA-342v=iFVk5dR5fOZ+2N3iEQQU9dOzYHycwuUWUi3mA@mail.gmail.com>
On 6/5/19, Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx> wrote:
> Hello,
> I've just waited a bit after: git checkout <TAB>. The delay was caused
> by the completion script loading all revisions, while I only wanted
> branches.
>
> This gave me an idea – to use exec {FD}< <(...) and zle -F to update
> the completion, after first displaying "Loading all revisions". In one
> project I'm passing as much as 13000 lines through the {FD} after each
> keypress without any problems.
...
> I'm not familiar with coding completions. Could someone else start the
> async-completions trend?
async-completions doesn't make any sense, you can't do anything else
while completing and you can already abort it by pressing ctrl-c. If
you want to show a message first, you can already do so, it will be
overwritten by the completion list once that's finished building. For
example I wrap the complete-word etc widgets with a function that
changes the cursor color, and then changes it back after, but you
could display a message instead if you want.
function _generic_cursorcol() {
#zle -R completing...
cursorcol cyan
{ _generic "$@" } always {
cursorcol_normal
}
}
() for 1 {
zle -C $1 $1 _generic_cursorcol
} complete-word reverse-menu-complete complete-word menu-complete
menu-expand-or-complete
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author