> On Apr 17, 2025, at 7:55 PM, Neil Hodgson <
nyama...@gmail.com> wrote:
>
> Mitchell:
> Currently, when SCI_SETUNDOSELECTIONHISTORY is enabled, undo restores both the selection and the top line (scroll) position. Can we add either an option or a bit-field to disable the latter?
>
> Yes. Added SC_UNDO_SELECTION_HISTORY_SCROLL to control whether the vertical scroll position is restored.
>
> This is an incompatible change in the sense that applications will need to set SC_UNDO_SELECTION_HISTORY_SCROLL | SC_UNDO_SELECTION_HISTORY_ENABLED to produce the previous behaviour. If this causes too much trouble for anyone, it could be replaced with a negation option ..._HISTORY_NO_SCROLL but negation flags are much less clear.
>
> > After thinking more on this, if the caret is outside the view, I’m fine restoring the scroll position. If the caret is in view, I’d prefer that the scroll position remain unchanged.
>
> When the caret is outside the view then the view is scrolled to make it visible using the normal caret policy settings.
Thank you very much! I like this change as written and will experiment with it soon.