Discussion:
Copy document pointer
Farshid Lashkari
2013-08-21 14:59:32 UTC
Permalink
I'm using SCI_SETDOCPOINTER to share multiple views of the same document.
However, when the user uses "Save As" to save a specific view to a
different file, I'd like to unshare the views. Is there a way to copy an
existing document, so all settings and undo history are still preserved?
The only thing I can find in the docs is SCI_CREATEDOCUMENT, but it seems
as though I would need to manually copy settings over and I would lose undo
history.
--
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 scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Neil Hodgson
2013-08-21 21:48:31 UTC
Permalink
Is there a way to copy an existing document, so all settings and undo history are still preserved? The only thing I can find in the docs is SCI_CREATEDOCUMENT, but it seems as though I would need to manually copy settings over and I would lose undo history.
There is no API to duplicate documents.

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 scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Matthew Brush
2013-08-21 22:11:04 UTC
Permalink
Post by Farshid Lashkari
I'm using SCI_SETDOCPOINTER to share multiple views of the same document.
However, when the user uses "Save As" to save a specific view to a
different file, I'd like to unshare the views. Is there a way to copy an
existing document, so all settings and undo history are still preserved?
The only thing I can find in the docs is SCI_CREATEDOCUMENT, but it seems
as though I would need to manually copy settings over and I would lose undo
history.
I've had similar issue a couple of times and I found the simplest way to
deal with it was to just create a function that (re)initializes the view
once the new document is set. You can use the same function for both the
initial setup of the view, which you have to do anyway, and whenever you
swap out documents, if you factor it correctly. I doubt this helps with
undo history though, I never actually thought about that before.

FWIW, I asked about this on the list before[1], you might find Neil's
replies useful.

Cheers,
Matthew Brush

[1]
https://groups.google.com/forum/#!msg/scintilla-interest/lpvRgfk9PJ0/i6xqiQ98DMAJ
--
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 scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Continue reading on narkive:
Loading...