Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-03

SynEdit

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Damien Gerard

Hi !

I have a strange behavior when using TSynEdit. Espacially when loading a Lua Script from a file (other I don't know).
All lines numbers are wrong.
If I manually type into the SynEdit it works well. When I load my file, it is like the attached screenshot.
I guess I do something wrong.

Here is my code :
procedure TImporterFrm.btnOpenClick(Sender: TObject);
begin
  if OpenDialog1.Execute then begin
    mmCode.Lines.LoadFromFile(OpenDialog1.FileName);
  end;
end;

What'is the "good" way to do it ?
Thanks !

Screenshot : http://ftn.shikami.org/misc/Lazarus/synEdit.jpg

Damien Gerard "Intelligence is 10 million rules." -- Douglas Lenat

Reply by email

Damien Gerard
to Vincent Snijders: The line number seem correct to me, only the last digit is not visible. Try to enlarge…

Le Mar 10, 2008 ? 11:46 AM, Vincent Snijders a ?crit :

Show quoted text 15 lines
Damien Gerard schreef: > Hi ! > > I have a strange behavior when using TSynEdit. Espacially when > loading > a Lua Script from a file (other I don't know). > All lines numbers are wrong. > > Screenshot : http://ftn.shikami.org/misc/Lazarus/synEdit.jpg The line number seem correct to me, only the last digit is not visible. Try to enlarge the gutter. Maybe the autosizing of gutter doesn't work when a new file is loaded.

Indeed you're right. The AutoSize was equals to True but it did not refresh as it should be.

   if OpenDialog1.Execute then begin
     mmCode.Gutter.AutoSize := False;
     mmCode.Lines.LoadFromFile(OpenDialog1.FileName);
     mmCode.Gutter.AutoSize := True;
   end;

this works well :)

Should I report this somewhere ?

Damien Gerard "Intelligence is 10 million rules." -- Douglas Lenat

Reply by email