Yes the array is as long as the SynEdit.Lines. It's a chache for the endline for that line. The same with FFirstCharacterColumn as cache for the
column of the first character in the line (this is the position of the vertical line).
I can not limit this to the lines in the window as i have to at least keep track of FFirstCharacterColumn as i have to draw vertical lines for nodes
that where opened before Topline or i have to refind the positions for every invalidation but we would like to save cpu/energy if i got you right.
All you need is a 2nd array (for each of the two), that contains all the node-infos opened before topline.
procedure Foo();
begin
if Message.WParam = WParam(FGroupIndex) then
begin
Sender := TCustomSpeedButton(Message.LParam);
if Sender <> Self then
begin
------------------- Topline
if Sender.Down and FDown then
begin
FDown := False;
FIrstBeforeTopline = (1, 3, 5); // does not matter on which line they are, just that they exist
First = (0 {visible line 1, nothing new opening // or is it 5 repeated?}, 7, 0 .... );
Of course you need to adapt things on scroll.... you need to know which line topline was before.
---------------------
If you must keep full length, then use the managed ranges. (one class can hold both: first and len)
See FTabDAta in TSynEditStringTabExpander.TextBufferChanged
This well automatically be kept always the same length as Lines, and if insert/delete happens this is automatically done in the right place (you only need to zero/initialize it.