Neil Hodgson wrote:
Robert Roessler:

If the user types an otherwise magic comment sequence, it will just be
treated as a normal comment(?).

   I'd treat a user's magic comment the same as other magic comments
as a bit more consistent.

While I can appreciate this viewpoint, I have the problem of wanting to use these for control information - and thus have a validity issue.

BUT, if the user does an Undo followed by a Redo, I have problems -
how to get the protected versions of the styles applied?  Since I am
blocked from receiving the [e.g.,] SC_MOD_CHANGESTYLE and restyling
magic comment sequences SYNCHRONOUSLY, I am in a bad spot (I think).

   Run the fix up asynchronously. That can cover both user cast magic
and user undo/redo.

You keep saying this (or close variations), but while Windows messages and messaging are things I find easy to use, my app is using the GTK widget version of Scintilla, and I do not really have a clear picture of a) how async messaging would work in this environment, or b) if any approach would work on all the platforms where GTK is nominally supported. Besides, explicitly asynchronous control logic can be headache-inducing (particular when not really necessary).

OTOH, you *could* consider allowing *style* modifications to nest (like markers) - the code (in Document::SetStyleFor() and Document::SetStyles()) didn't look too far from being workable already - I just am a bit unclear about how to handle endStyled.

Key to both of these, of course, is to still track enteredCount, and be smart about issuing notifications - maybe only allow one level of recursion, and decide to call NotifyModified a) the first time, or b) both times, depending on how things will work with nesting (or not) Redraw() or InvalidateRange() calls... we certainly do not want any endless loops. :)

I can whip this up too, although a sage word or two regarding endStyled would be nice.

So I *could* wipe the Undo stack (setting a Save Point is the
equivalent for my app) right after "officially" inserting one or more
of the magic sequences... no Undo to worry about!  Is this reasonable,
or too extreme?

   If I was your user I'd hate you.

Hey, desperate times call for desperate measures - give me a more flexible tool (or a better solution) - I certainly don't need [more] users hating me. ;)

Robert Roessler
[EMAIL PROTECTED]
http://www.rftp.com
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to