zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: overeager use of stat list format
@ 2015-12-14 11:05 Peter Stephenson
  0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 2015-12-14 11:05 UTC (permalink / raw)
  To: Zsh Hackers' List

This must have been there for ages, though I've only just noticed by
trying to complete in my zsh functions directory which contains lots and
lots and lots of files.

I have the file-list style set to list=10 which means display as ls -l
if I'm listing and I have no more than 10 files to list.

It turns out owing to a typo in the pattern it can match if I'm not
listing and I have any number of files at all.  So normal completion
with TAB just hung up for ages and as it didn't display the listing
there was no obvious reason.

The moral is the usual one: be careful about designing patterns that
aren't supposed to match a certain type of string.

I'm worried I'm only seeing this because something else just got a lot
more inefficient, but I'm not going to be looking at that myself.
(Alternatively, I may have fixed some obscure pattern bug with a
knock-on effect.)

pws

diff --git a/Completion/Unix/Type/_list_files b/Completion/Unix/Type/_list_files
index e04392d..6c52bc1 100644
--- a/Completion/Unix/Type/_list_files
+++ b/Completion/Unix/Type/_list_files
@@ -36,7 +36,7 @@ for elt in $stylevals; do
     break
     ;;
 
-    (*($what|all|true|1|yes)[^=]#)
+    ([^=]#($what|all|true|1|yes)[^=]#)
     # always use long format
     (( ok = 1 ))
     break


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-14 11:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-14 11:05 PATCH: overeager use of stat list format Peter Stephenson

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