Neil Hodgson wrote:
Robert Roessler:
This seems like a good place to bring up a problem I see with what I
(and Armel?) want to do - if there are, say, two "protected" regions
in your buffer and the user deletes all of the text between them, what
happens next? With Scintilla's current implementation of protected
text, it is not possible to move the cursor "into" the now-joined
range... is Undo your only friend at this point?
If your app want to maintain the separation, it could add a space
whenever the regions join.
It would be better to allow positions within a read-only zone where
the caret could go but I can't see an easy implementation of that.
Well, it looks easy/safe enough to slightly modify
Editor::MovePositionOutsideChar() so that after checking IsProtected()
an additional check is made for the presence of an indicator with a
style like INDIC_HIDDEN (or a new one for this purpose); if there,
then it would mean "valid positioning point".
For that matter, I wouldn't mind having *any* indicator in a protected
region meaning "valid positioning point", but that might be considered
too extreme a semantic change.
How does this sound? It would allow you to use the existing protected
machinery while providing explicitly defined "breaks" within regions.
BTW, we couldn't use IsProtected() per se, since it is checking for
hidden styles too (we wouldn't want to allow positioning within
*them*), but this does not change the basic idea.
Performance-wise, we are only doing extra work *after* we detect a
protected style, so the impact should be a) confined to buffers using
protection, and b) minimal/negligible in any case.
Robert Roessler
[EMAIL PROTECTED]
http://www.rftp.com
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest