Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
When you know completion will be slow ...
- X-seq: zsh-workers 32358
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: When you know completion will be slow ...
- Date: Thu, 06 Feb 2014 08:04:43 -0800
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Completion functions that are going to perform potentially slow operations
(e.g., "git ls-files" is unpredictable on large repos, or the example from
recently on zsh-users of "system_profiler -listDataTypes") could warn the
user that there will be a delay.
The "zle -M" command works from inside a completion widget, and will erase
the completion listing (which is then redrawn), so it could be used to
display a message just before the long operation begins. Unfortunately it
is not "safe to call" in the way that "zle -R" is, so may need to test that
zle is active with "zle && zle -M ..." ("zle -R" also works, but covers up
the first line of the completion listing which is then never redrawn).
This seems to interoperate safely with menu-selection as well. If this is
deemed a good idea, we might want to document a standard zstyle name for it
so it can be turned on/off for properly written completion functions.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author