Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Candidates hidden by prior wrapped long candidate under terminal #1809

Closed
basil-conto opened this issue Nov 18, 2018 · 4 comments

Comments

@basil-conto
Copy link
Collaborator

commented Nov 18, 2018

  1. make emacs='emacs -nw' plain

  2. (setq ivy-height 5
          resize-mini-windows t)

    C-j

  3. (ivy-read "prompt: " (nconc (mapcar #'number-to-string
                                        (number-sequence 0 (* ivy-height 2)))
                                (list (make-string (* (window-text-width) 2) ?w)
                                      "foo"
                                      "bar")))

    C-j

  4. M->

    resize-4
    Note that the last two candidates foo and bar are hidden by the previous multi-line candidate, and only two candidates are shown instead of four.

Tested in the following Emacs versions:

In GNU Emacs 25.2.1 (x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2018-08-27, modified by Debian built on x86-csail-01
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
System Description:	Debian GNU/Linux testing (buster)

In GNU Emacs 26.1.50 (build 6, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2018-11-01 built on thunk
Repository revision: d53a2b65db9952580efcf5ffe75a313bcb49a99e
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
System Description:	Debian GNU/Linux testing (buster)

In GNU Emacs 27.0.50 (build 53, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2018-11-16 built on thunk
Repository revision: 644a308b4e1513e04be9360e1586e14b32ec0159
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
System Description: Debian GNU/Linux buster/sid

Re: #1807.

@abo-abo

This comment has been minimized.

Copy link
Owner

commented Nov 18, 2018

Thanks, please test.

@basil-conto

This comment has been minimized.

Copy link
Collaborator Author

commented Nov 19, 2018

Thanks, but unconditionally enabling truncate-lines doesn't really solve the problem, as it reintroduces the kind of minibuffer collapsing described in #77, #229, #237, and #1528. If you try the recipe in the OP you will see that the minibuffer window shows only the prompt and nothing else.

@abo-abo

This comment has been minimized.

Copy link
Owner

commented Nov 20, 2018

Ok, I see it now. We might have to go with a complex solution after all. Could we get away with recommending or setting this for non-graphical Emacs?

(setq resize-mini-windows 'grow-only)

@abo-abo abo-abo reopened this Nov 20, 2018

@abo-abo abo-abo closed this in c1c1ec7 Nov 20, 2018

basil-conto added a commit to basil-conto/swiper that referenced this issue Nov 20, 2018
ivy.el: Fix minibuffer truncation & resizing
The last attempt[1] to fix abo-abo#1809 permanently changed the value of
user option resize-mini-windows under a text terminal. Fix this by:

(ivy--minibuffer-setup): Move resize-mini-windows logic from here...
(ivy-read): ...to here.

[1]: ivy.el: For non-graphical Emacs set resize-mini-windows to 'grow-only
  2018-11-20 11:04:14 +0100 c1c1ec7

Fixes abo-abo#1809
@basil-conto

This comment has been minimized.

Copy link
Collaborator Author

commented Nov 20, 2018

Could we get away with recommending or setting this for non-graphical Emacs?

Documenting limitations such as that Emacs does not currently handle non-nil truncate-lines in the minibuffer very well (see e.g. bug#5715 and bug#9572), and the combined effect this has with resize-mini-windows, is always a good thing. I think Ivy already recommends other settings as well, so the above would be a welcome addition.

What we can't get away with, though, is permanently changing the value of the user option resize-mini-windows; #1811 fixes this.

abo-abo added a commit that referenced this issue Nov 20, 2018
ivy.el: Fix minibuffer truncation & resizing
The last attempt[1] to fix #1809 permanently changed the value of
user option resize-mini-windows under a text terminal. Fix this by:

(ivy--minibuffer-setup): Move resize-mini-windows logic from here...
(ivy-read): ...to here.

[1]: ivy.el: For non-graphical Emacs set resize-mini-windows to 'grow-only
  2018-11-20 11:04:14 +0100 c1c1ec7

Fixes #1809
Fixes #1811
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.