Re: Request for SCI_SETUNDOSELECTIONHISTORY to make top line restoration optional

Neil Hodgson <[email protected]> Thu, 17 Apr 2025 16:55:56 -0700 (PDT)
Newsgroups gmane.comp.lib.scintilla.devel
Message-ID <[email protected]>
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.

The changes can be examined either in the repository

  hg clone http://hg.code.sf.net/p/scintilla/code scintilla

or from

  https://www.scintilla.org/scite.zip Source
  https://www.scintilla.org/wscite.zip Windows executable (64-bit)

Neil

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/scintilla-interest/48c37462-7cc7-4e9b-b3d7-4eb35b2d539en%40googlegroups.com.