-
-
Notifications
You must be signed in to change notification settings - Fork 338
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
Swiper not scroll on exit #2159
Comments
Please add a reproduction scenario. |
Hi abo-abo: Thanks for taking care of this. Suppose that there is a buffer with actual visible lines from 100 -> 150. And the candidates are in lines: When I start swiper, the minibuffer will hide the lines 142 -> 150 that were visible before, so the candidates in line 145 will be hidden while swiper is on. there are 3 scenarios on exit swiper as now: 120, 130 : it is fine now, they stay where they are before and after. Probably it is easier to set somehow the second and third case to avoid any scroll on ivy-exit; so they behave like case 1? The interesting thing is that in some cases 3) it already does that, but this happens randomly. Thanks in advance, |
Please add a sample file. |
Hi Abo-Abo: It happens with any file. I just made M-150 M-x lorem-ipsum-insert-list. But to give you a file it will change depending of your screen size, font-size and how many visible lines do you have at the time and what's the ivy-height you have. For example for case 2) you can try with the *Packages* buffer and search: ack (in my case because it is in line 55 and my last line visible is 56) but there are possible candidates in many other lines far bellow (because matching in background). For case 3) (and the worst case) If you search: swiper (where candidates are very sparse) and you go to one of the the last candidate and change directio (C-p) to one of the previous candidates (not the initial); you will see that the candidate will appear in the top of the screen (when swiper is on), but when you C-m it will scroll to put the selected one in the bottom of the screen. (same happen in the opoosite direction) |
OK, thanks. I can reproduce now. Here's what I would have preferred in an issue report, for future reference.
Your issue should be solved with this: (defun swiper--recenter-p ()
t) This uncovered one more issue that |
Hi Abo_Abo |
Hi:
Sorry for the bother with such a small detail.
I am just wondering if it is possible somehow to avoid the small scroll that takes places when exiting swiper (ivy-alt-done).
Sometimes when selecting a candidate swiper makes a recenter or scrolls when closing the minibuffer (if the candidate was out of the screen before starting swiper or in the portion of the screen that swiper occupies when opened). This makes that the selected candidate/line moves to the top or down in the screen when swiper closes which is somehow annoying.
I think it is a more comfortable (better user experience) if when selecting a candidate it's line always keep the relative position to the top of the screen (as it happens with the initial visible candidates on the top of the screen). Because the user could keep his eyes in the selected line and does not need to search again with the eyes for the cursor. It will feel like if the minibuffer has closed and will be less distracting.
Does it makes sense? Maybe there is already a method to configure this that is not documented?
Thanks in advance,
Ergus
The text was updated successfully, but these errors were encountered: