If the displayed text contains hidden text (using
SCI_STYLESETVISIBLE) then the editing seems to be
messed up. E.g. if you select a block of text which
contains hidden text and try to delete nothing happens.
It is very annoying.
Logged In: YES
This is behaving as designed.
The original design was for text that contained formatting
commands like "[blue]URL [black]for download" where the
formatting commands were hidden and deleting them would
remove the formatting. The container was expected to provide
its own deletion commands (so deleting " [black]for" would
move the active formatting command to the end of the
deletion producing "[blue]URL[black] download") and would be
protected against other causes of deletion. Not much work
has been done on this sort of feature so the range of
semantics needed is unknown. Any modification should start
with a clear idea of the range of semantics needed.
If you just want to turn this off for your work, in Style.h,
change IsProtected to ignore visible and recompile.
Logged In: YES
I see your point here but I'm not sure this design is quite
useful as there is now way to apply delete properly.
Actually the solution needed here is to hide the formatting
tags as well as to join them to the formatted text. E.g.
when [blue]URL[/blue] is selected for copy then not only the
URL but also the formatting tags should be placed to the
> If you just want to turn this off for your work, in Style.h,
> change IsProtected to ignore visible and recompile.
That's where I have started but it resulted weird results
(deleting the last char of the hidden text it won't be
hidden anymore). Therefore I have hacked this around by
using hidden property on the formatting tags and protected
on the URL bit. Then slightly reworked the delete functions
in your code (uncommented the checks agains IsProtected).
Now the formated text can not be edited and joined to its
formatting markup but it can be edited. This is exactly what
I wanted here.
BTW your code is far more the best formatted and
understandable code among the open source codes what I have
seen recently. Well done.