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

Restore window position after using swiper. #643

merged 1 commit into from Aug 30, 2016

Restore window position after using swiper. #643

merged 1 commit into from Aug 30, 2016


Copy link

@ghost ghost commented Aug 30, 2016

After exiting swiper, re-search-forward is used to go to the match, and when some variables like scroll-conservatively are set to high values, this causes a 'jumping' behavior where the cursor was somewhere near the middle and now is near the bottom or top of the screen.

This patch saves the window start position and restores it.

This should fix #642 .

This prevents a "jumping" behavior which occurs when variables
such as `scroll-conservatively' are set to a high value.

* swiper.el (swiper--current-match-start): Hold the window-start
position for restoration.
(swiper--action): If `swiper-action-recenter' is nil, then restore
the window-start that was used during selection.
@abo-abo abo-abo merged commit 4c3ecb4 into abo-abo:master Aug 30, 2016
Copy link

abo-abo commented Aug 30, 2016


abo-abo added a commit that referenced this pull request Feb 5, 2019
astoff pushed a commit to astoff/swiper that referenced this pull request Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

"Smart" recenter after swiper finishes
1 participant