zsh-workers
 help / color / mirror / code / Atom feed
From: "Jun. T" <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Cc: Marlon Richert <marlon.richert@gmail.com>
Subject: Re: Bug report: complist miscalculates width of display strings containing a slash (/)
Date: Mon, 5 Apr 2021 01:08:14 +0900	[thread overview]
Message-ID: <7CD89E1D-3B11-42B1-A794-F09E5A32F16C@kba.biglobe.ne.jp> (raw)
In-Reply-To: <CAHLkEDtbnFmKiFZ4rgXLvZfo3Fux7yUWbMhF8k5jHKA=j47dMw@mail.gmail.com>


> 2021/03/27 7:49, Marlon Richert <marlon.richert@gmail.com> wrote:
> 
> The following test causes the command line to jump and the completion
> menu to visually break ...

Thank you for reporting, and sorry for not responding quickly.

It seems the problem occurs if both '-d disp' and '-f' are given to
compadd, and menu-select is called.
# It becomes more serious if width of the list of completions
# is equal (or close?) to the screen width due to the wrapping.

The following patch add an extra width 1 for the trailing file-type
indicator (/ for directory, etc.) when '-d disp' is given, just as for
the case without '-d disp' (line 2351, 15 lines below the patched line).



diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c
index 30fc60b78..8b5955819 100644
--- a/Src/Zle/compresult.c
+++ b/Src/Zle/compresult.c
@@ -1583,7 +1583,7 @@ calclist(int showall)
                             nlines += 1 + printfmt(m->disp, 0, 0, 0);
                             g->flags |= CGF_HASDL;
                         } else {
-                            l = ZMB_nicewidth(m->disp);
+                            l = ZMB_nicewidth(m->disp) + !!m->modec;
                             ndisp++;
                             if (l > glong)
                                 glong = l;





      reply	other threads:[~2021-04-04 16:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26 22:49 Marlon Richert
2021-04-04 16:08 ` Jun. T [this message]

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=7CD89E1D-3B11-42B1-A794-F09E5A32F16C@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --cc=marlon.richert@gmail.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).