From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12771 invoked by alias); 3 Oct 2013 16:19:54 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31781 Received: (qmail 13956 invoked from network); 3 Oct 2013 16:19:38 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <131003091936.ZM1364@torch.brasslantern.com> Date: Thu, 03 Oct 2013 09:19:36 -0700 In-reply-to: <131003080956.ZM1033@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: Bug somewhere in verbose output for completion listing" (Oct 3, 8:09am) References: <20131003140025.227f5bc1@pwslap01u.europe.root.pri> <131003075018.ZM991@torch.brasslantern.com> <131003080956.ZM1033@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: "Zsh Hackers' List" Subject: Re: Bug somewhere in verbose output for completion listing MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Oct 3, 8:09am, Bart Schaefer wrote: } } Well, one maybe: There's a static global struct in computil.c called } cd_state that has maxmlen and minmlen fields. Those are based on the } exported globals maxmlen and minmlen from compcore.c, which the comment } (there's a comment!) describes as "Length of the longest/shortest match". OK, right track, wrong details. (There is no cdstate.minmlen) The problem is with cd_state.premaxw, which is the padding width. This gets set in cd_calc() but is never changed unless it gets larger. The following superfically fixes it, but I haven't checked in detail what happens in cases where the same list is being re-used (e.g. by _oldlist) for successive completions. I also haven't checked the case of multiple completions in different groups (the case from the old thread I linked earlier), or whether the LIST_PACKED option has any effect either way. diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index f8983c3..ee39185 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -465,6 +465,7 @@ cd_init(char *nam, char *hide, char *mlen, char *sep, cd_state.showd = disp; cd_state.maxg = cd_state.groups = cd_state.descs = 0; cd_state.maxmlen = atoi(mlen); + cd_state.premaxw = 0; itmp = zterm_columns - cd_state.swidth - 4; if (cd_state.maxmlen > itmp) cd_state.maxmlen = itmp;