> Any thoughts? I'll be glad to help with coding changes to the scintilla
> source. I'm pretty good with C++. Or is scintilla's marker behavior
> that way intentionally? It seems like other apps would benefit from
> this change, too...
The current behaviour is intentional. For many uses of markers,
including them in Undo would be wrong. For example, in a debugging
session, I am unlikely to want a breakpoint reinstated if I return to
an earlier version. I am not opposed to adding a very simple way to
insert application actions into the Undo history.
> C: Cut/Paste/Selection Deleting actions are considered insertions or
> deletions.
From the point of view of Undo all actions are insertions or deletions.
> D: I need to record the initial position of the cursor and the final
> position of the cursor for each action. Upon undo, I go to the final
> position of the cursor and remove text backward (if inserted) or insert
> text forward (if deleted)
The cursor position is not remembered in Undo. The position of the
insertion/deletion is. Not all actions are performed on the selection.
SCI_REPLACETARGET is often used because it doesn't affect the cursor.
Neil
Thanks for writing me back! I have no problem if the marker code is
supposed to be that way. I'll just do it on my end.
The only thing I would really like to have is a way to be notified when
UndoHistory switches actions. I can do it without this but this would
give me verification that my choices are correct to catch errors... I
have been surprised by this upon testing sometimes...
Is it possible to get this info using the existing API? If not it isn't
that big a deal...
Thanks,
-David
Neil Hodgson wrote:
> The current behaviour is intentional. For many uses of markers,
> including them in Undo would be wrong. For example, in a debugging
> session, I am unlikely to want a breakpoint reinstated if I return to
> an earlier version. I am not opposed to adding a very simple way to
> insert application actions into the Undo history.
>
> From the point of view of Undo all actions are insertions or deletions.
>
>
> The only thing I would really like to have is a way to be notified when
> UndoHistory switches actions. I can do it without this but this would
> give me verification that my choices are correct to catch errors... I
> have been surprised by this upon testing sometimes...
I'm unsure exactly what you mean by switching actions. Is
SC_STARTACTION what you are seeking? Unfortunately it is not possible
to have an equivalent SC_ENDACTION flag since you don't know at the
time of typing one character whether the user will type another which
belongs in the same undo step.
Neil