I've just tried it in Ubuntu and auto numbering when typing just doesn't work.
I guess this is a limitation of the widget in the OS.
What you
can do is first just add all the lines you want (with #13 / new lines separated).
Then apply the numbering to your desired text.
Something like this:
procedure TForm1.Button2Click(Sender: TObject);
var
pn: TParaNumbering;
begin
RichMemo1.Clear;
RichMemo1.Lines.Add('First item');
RichMemo1.Lines.Add('Second item');
RichMemo1.Lines.Add('Third item');
pn.Style := pnNumber;
pn.Indent := 14;
pn.NumberStart := 1;
pn.SepChar := SepDot;
RichMemo1.SetParaNumbering(0, Length(RichMemo1.Lines.Text) - 1, pn); // -1 so the last line doesn't get a number
end;
BTW. There is a unit RichMemoHelpers which has some extra helper functions.
When adding the RichMemoHelpers to your uses you can directly access SelAttributes without needing to fiddle with a separate record.
uses RichMemoHelpers;
//...
RichMemo1.SelAttributes.Color:= clBlue;
RichMemo1.SelAttributes.Style := RichMemo1.SelAttributes.Style + [fsBold, fsItalic];
Unfortunately there is no such helper for the ParaNumbering.
But it does for TParaMetric in Paragraph.