> I stumbled on a modified scintilla version (Code::Blocks) that have
> implemented change margin support.
>
> I was wondering if any official support for this was planed ?
The implementations I have seen are inaccurate and use excessive
storage. A good implementation would be useful.
Neil
Is there a good description of this feature somewhere?
What it looks like, what is the logic behind the rendering...
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --
> Please find this new version of patch :
> http://pastebin.com/qGde60U1
Looks like it doesn't restore when undoing.
Neil
> In this patch, I store the information into Action of UndoHistory.
> There are some unaccurencies with the managment of undo/redo.
> For example :
> - if you insert (via copy&paste) a block of text.
> - you modify some line of this block of text.
> - you save the file
> - you undo until remove this block of text.
> - you redo insert (all block of text is considered like dirty, that's
> wrong but difficult to manage...)
> - you redo until savepoint (all block of text is cleaned).
I've been down similar paths and they have ended up too complex and heavy.
Expanding the size of undo steps is bad for clients that do not use
this feature so it may be better to implement this as a parallel data
structure that can be completely off.
Neil
> With the current patch, the size of undo step is always increased by
> one pointer (4 bytes or 8 bytes according to architecture), if the
> user doesn't use this feature, then this pointer can be initialise to
> NULL. Do you think that expanding is too important?
Code tends to bloat out if you don't check all changes for size
increases and it can be a lot of work to undo this as I did earlier to
reduce per-line data for optional features. I've been meaning to
reduce the memory used for undo since it really isn't optimal and this
makes Scintilla less viable for some applications.
> Put data into undo step, seems to me more comfortable because, it
> there is no synchronization with undo stack and this future parallel
> data structure.
There wouldn't be any complex mapping. They would both be arrays
with element n in the undo stack corresponding to element n in the
change bar undo.
> I maybe found one solution to manage this case with acceptable design.
> But the current patch use only one byte (unsigned char) per line to
> manage this feature. If we want manage this kind of case, then I think
> that I have to use 2 bytes (2 unsigned char) per line (1 byte to store
> the status at save point and 1 byte to store current status) and
> don't reset the status to "maskHasBeenSaved | noChange" when save
> point is reached.
A single byte may not have enough values to be safe: Typing a
single 80 byte line will use 80 values up.
Visual Studio uses 4 states: original, changed, saved change and
saved change that has been undone.
Neil
Neil
> Please find this new patch : http://pastebin.com/LjBdZimH
>
> - Where I use document notification for redraw select margin.
I can't see any notification code in Document.cxx there. You could
use the approach from my earlier version in
http://scintilla.sourceforge.net/scitecb.zip
> - I fix somes inaccuracies (it's pretty tricky to fix those
> inaccuracies without regression...).
I'm not sure this approach is strong enough to cover all the cases.
The change margin does not have to be completely accurate but there
should be a solid story to tell like: "A line is coloured if and only
if it has been changed. The colour may be wrong in these circumstances
in this way". Otherwise its going to be difficult answering bug
reports.
There is no need for changing copyright years or including change
logs inside code files. I'm going to stop accepting changes to the
year ranges as they are just noise. Change logs only work for files
that see few changes and become an incomplete mess for other files
unless there are strong rules about when and what to add. Changes are
much better documented inside source code control as that also
includes the set of files involved in a change.
Neil
> I can't see any notification code in Document.cxx there. You could
> use the approach from my earlier version in
> http://scintilla.sourceforge.net/scitecb.zip
As a patch:
http://scintilla.org/changebar.patch
Neil