zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Sebastian Gniazdowski <sgniazdowski@gmail.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Asynchronous completions?
Date: Wed, 5 Jun 2019 09:57:14 +0200	[thread overview]
Message-ID: <CAHYJk3TWiB8mZsn30L3sqG-qSjMry6hcmevn+QCAF0ueVdiKqQ@mail.gmail.com> (raw)
In-Reply-To: <CAKc7PVA-342v=iFVk5dR5fOZ+2N3iEQQU9dOzYHycwuUWUi3mA@mail.gmail.com>

On 6/5/19, Sebastian Gniazdowski <sgniazdowski@gmail.com> 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

  reply	other threads:[~2019-06-05  7:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-04 22:01 Sebastian Gniazdowski
2019-06-05  7:57 ` Mikael Magnusson [this message]
2019-06-05  9:47   ` Peter Stephenson

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=CAHYJk3TWiB8mZsn30L3sqG-qSjMry6hcmevn+QCAF0ueVdiKqQ@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=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).