zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: PATCH: overeager use of stat list format
Date: Mon, 14 Dec 2015 11:05:40 +0000	[thread overview]
Message-ID: <20151214110540.41096af2@pwslap01u.europe.root.pri> (raw)

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


                 reply	other threads:[~2015-12-14 11:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20151214110540.41096af2@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.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).