Skip to content
This repository was archived by the owner on Jun 25, 2024. It is now read-only.

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
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant