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

Handle situations when actual height of minibuffer is not enough. #12

Closed
AmaiKinono opened this issue Jan 28, 2020 · 7 comments
Closed

Comments

@AmaiKinono
Copy link
Contributor

There's a variable max-mini-window-height that controls the maximum height of the minibuffer window, and it can cause the actual height being smaller than (1+ selectrum-num-candidates-displayed). So this may happen:

goes-outside

selectrum-num-candidates-displayed is 10, but the actual height of the minibuffer is 9, so the cursor goes outside of the boundary.

Besides, multi-line candidates also cause problem, like when browsing a kill-ring:

goes-outside-2

@raxod502
Copy link
Member

Good catch. I think both problems can be solved by the same fix. We just have to keep track of the actual number of display lines as candidates are inserted, and stop at the appropriate point.

@AmaiKinono
Copy link
Contributor Author

I just notice that the next/prev page commands also have this problem. They should be fixed too.

@raxod502
Copy link
Member

Let me know what you think of this implementation.

@raxod502 raxod502 added the waiting on response Needs more info or follow-up, will be closed after 90 days if no response label Apr 18, 2020
@AmaiKinono
Copy link
Contributor Author

I've tested it and read the code. The "undesirable gradual scrolling effect" you described actually doesn't only happen for long candidates, but also when the height of the minibuffer is small (due to max-mini-window-height) and the user holds C-n to scroll down.

I think the implementation is acceptable from a user's perspective, and I doubt whether it can be done better.

@raxod502
Copy link
Member

I think the implementation is acceptable from a user's perspective

OK, closing.

The "undesirable gradual scrolling effect" you described actually doesn't only happen for long candidates, but also when the height of the minibuffer is small

Oh really? That's surprising to me, from my understanding of the algorithm it should be impossible for the scrolling case to trigger unless there is a multiline candidate somewhere. Are there particular conditions you have to follow to get this behavior?

@raxod502 raxod502 removed the waiting on response Needs more info or follow-up, will be closed after 90 days if no response label Apr 18, 2020
@AmaiKinono
Copy link
Contributor Author

Are there particular conditions you have to follow to get this behavior?

No, just resize the window so you can't have a minibuffer that satisfies selectrum-num-candidates-displayed, and run any command like M-x, and hold C-n. I'm sure there aren't any multiline candidate in M-x.

I tried to record a gif, but it can't show the problem. I also tested using emacs -Q, the problem exists, but not so intense (to my eyes it's like the current candidate blinks sometimes, which should be caused by a really fast "gradual scroll"). My guess is it has something to do with the performance of my configuration and maybe my PC.

@raxod502
Copy link
Member

I can see that as well. You could open a new issue for it if you like.

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

No branches or pull requests

2 participants