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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore window scroll after popup close #361

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

45mg
Copy link

@45mg 45mg commented Feb 7, 2024

Currently, if displaying the popup would hide point, the window is scrolled to prevent this; but it is not scrolled back when the popup closes. This can be disorienting when the popup is tall, as the scroll changes by a large amount.

The solution is to store the scroll position of the selected window before showing the popup, and restore it after closing it.

#321 added an option to do the same thing, but only for the side-window popup type, and using set-window-configuration which is dangerous as discussed there. This solution should work for any popup function.

I didn't remove/deprecate the option introduced in #321, as users may have come to rely on side-effects from set-window-configuration (but mostly because it would put me over 15 lines 馃檪).

@45mg 45mg force-pushed the restore-scroll-after-popup-close branch from f610eff to 1105149 Compare February 7, 2024 15:20
Currently, if displaying the popup would hide point, the window is
scrolled to prevent this; but it is not scrolled back when the popup
closes. This can be disorienting when the popup is tall, as the scroll
changes by a large amount.

The solution is to store the scroll position of the selected window
before showing the popup, and restore it after closing it.
@45mg 45mg force-pushed the restore-scroll-after-popup-close branch from 1105149 to 40abb43 Compare February 7, 2024 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant