Hello,

I noticed that even this fails:

SynEdit1.SelStart := SynEdit1.SelStart;

The problem is that the cursor position is set to the left with every execution because the linebreak characters are ignored when calculating the character indexes (in SynEditTextBuffers.pas). Here is the corrected version:

procedure TSynEditStringList.UpdateCharIndexes;
var
  i, n : Integer;
  p : PSynEditStringRec;
begin
  FCharIndexesAreValid:=True;
  if fCount=0 then Exit;
  p:=@fList^[0];
  n:=0;
  for i:=1 to fCount do begin
    p.fCharIndex:=n;
    Inc(n, Length(p.FString) + 2); // changed, before it was without "+ 2"
    Inc(p);
  end;
end;

I don't know whether this works always, because I don't know if we have always 2 linebreak characters in SynEdit. For me this works fine.

Can somebody please check this and change it in the repository?

Thank you,
Kind regards,
Sebastian Jänicke