Re: Saving selection into undo history

Neil Hodgson <[email protected]> Tue, 4 Feb 2025 02:24:11 -0800 (PST)
Newsgroups gmane.comp.lib.scintilla.devel
Message-ID <[email protected]>
jpe:

... (the first visible line). Any chance the scroll position could be added?


Yes but I'm unsure whether it needs to be optional. At maybe 8 bytes per 
remembered undo and redo state its not likely to be a significant use of 
memory.

To ensure that the selection is still seen if the window has been made 
shorter or a wrapped window narrower, a common method is to first set the 
top line then call EnsureCaretVisible or similar. 
 

Could there be an option to delete the ModelState for a view? We create 
more that one view if the document is visible in more that one widget and 
then destroy the extra views when the widgets are destroyed.


I forgot to delete the ModelState from the document when the view was 
destroyed so new commits fix that and also delete the ModelState when the 
application turns off the feature.
https://sourceforge.net/p/scintilla/code/ci/e7e6d599bfb322bab6fb7aab7de5fcecd73e3821/ 
https://sourceforge.net/p/scintilla/code/ci/32b690e75f034efad38cd05a76a359ba60af58e2/

There are cases where other behaviour could be useful. Say an application 
has commands to split a view in two and to close the second view. It may be 
better to allow the second view to retain its undo selection history over 
the close. To the user, the second view was just hidden even when the 
application destroyed it to save memory. This would require some more 
management of view identity by the application.

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/6f401115-1f1d-40d4-aeac-211f1129ea82n%40googlegroups.com.