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

Correct ivy-fixed-height-minibuffer size #737

Closed
wants to merge 1 commit into from
Closed

Correct ivy-fixed-height-minibuffer size #737

wants to merge 1 commit into from

Conversation

@DarthFennec
Copy link
Contributor

@DarthFennec DarthFennec commented Oct 26, 2016

Correct the minibuffer height when ivy-fixed-height-minibuffer and
ivy-add-newline-after prompt are both t.

Fixes #732

Correct the minibuffer height when ivy-fixed-height-minibuffer and
ivy-add-newline-after prompt are both t.
@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Oct 27, 2016

It seems your code and mine should behave the same if ivy-add-newline-after-prompt is t.
But your code increases height by 1 even if ivy-add-newline-after-prompt is nil. Doesn't seem correct, can you check again?

@DarthFennec
Copy link
Contributor Author

@DarthFennec DarthFennec commented Oct 27, 2016

I don't think so. Your code seems like it would add 1 to the maximum height if ivy-add-newline-after-prompt is t, which is not related to the problem I'm having (If I wanted 1 added to my maximum height I would have just set ivy-height appropriately). The reason I say "seems like" is because for me it didn't even do that; your code had no effect at all for me. I'm not really sure why.

My problem is with ivy-fixed-height-minibuffer. Regardless of the value of this variable, if there are enough items in the list, the minibuffer will be restricted to ivy-height, and that works perfectly for me. On the other hand, when there aren't very many items, ivy-fixed-height-minibuffer is supposed to grow the buffer to ivy-height anyway, which also works for me in most cases. The problem is that when I also have ivy-add-newline-after-prompt enabled, the buffer in this case grows to one less than ivy-height, even though when the buffer is full it becomes ivy-height.

But your code increases height by 1 even if ivy-add-newline-after-prompt is nil.

I don't think so ... my code is:

   (when ivy-fixed-height-minibuffer
 -    (set-window-text-height (selected-window) ivy-height))
 +    (set-window-text-height (selected-window)
 +                            (+ ivy-height
 +                               (if ivy-add-newline-after-prompt
 +                                   1+                                 0))))

It increases height by 1 if ivy-add-newline-after-prompt is t, and by 0 if it's nil. But it only does this when ivy-fixed-height-minibuffer is t, in the code that grows the window. I don't want my maximum height to change, I just want the buffer to grow to that max height, instead of one less than that height.

@abo-abo abo-abo closed this in 3d600b6 Oct 28, 2016
@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Oct 28, 2016

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants