zsh-workers
 help / color / mirror / code / Atom feed
* When you know completion will be slow ...
@ 2014-02-06 16:04 Bart Schaefer
  2014-02-07 12:21 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2014-02-06 16:04 UTC (permalink / raw)
  To: zsh-workers

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-07 16:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-06 16:04 When you know completion will be slow Bart Schaefer
2014-02-07 12:21 ` Peter Stephenson
2014-02-07 16:14   ` Bart Schaefer

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).