[solved] Synedit bug lazarus / 31-LCL ---------------------------------------------------------------------- pik33 · 2011-08-03 11:25 To reproduce: Make a new app. Place synedit and button on it. Then add a method to the button: procedure TForm1.Button1Click(Sender: TObject); begin   synedit1.lines.clear;   synedit1.lines.add('aaaaa');   synedit1.lines.add('bbbbb'); end;  After button click, I got two empty lines in synedit, numbered -1. To have properly displayed my added lines, I have to click on Synedit Lazarus x64; SVN 31673, OpenSuse 11.4, KDE 4.6.5, GTK2, QT (bug in both). Didn't test this in Windows. I am writing an application which uses synedit and this kind of code (lines.clear and then lines.add) worked OK in older versions (maybe March) of Lazarus. Now, when I open my file, I got editor full with empty lines numbered -1 until I do something (click, scroll) with synedit control. Adding lines like synedit1.refresh or synedit1.getfocus didn't help. Is this bug (or any workaround) known or may I report this in bug tracker? ---------------------------------------------------------------------- Martin_fr · 2011-08-03 11:50 Indeed, confirmed, can you report on mantis please? -- EDIT: No need anymore: fixed in rev 31852 ---------------------------------------------------------------------- pik33 · 2011-08-03 12:14 Reported, bug #0019880 Edit: Thank you for resolving; waiting for this rev to be available for download on snapshot page ---------------------------------------------------------------------- Martin_fr · 2011-08-03 13:23 In case you want to patch your current version: Code: [Select]Index: synedit.pp =================================================================== --- synedit.pp (revision 31851) +++ synedit.pp (revision 31852) @@ -4842,8 +4842,11 @@      exit;    end;    if not assigned(FHighlighter) then begin -    if ATextChanged then +    if ATextChanged then begin        fMarkupManager.TextChanged(FChangedLinesStart, FChangedLinesEnd); +      // TODO: see TSynEditFoldedView.LineCountChanged, this is only needed, because NeedFixFrom does not always work +      FFoldedLinesView.FixFoldingAtTextIndex(FChangedLinesStart, FChangedLinesEnd); +    end;      Topline := TopLine;      exit;    end; ---------------------------------------------------------------------- pik33 · 2011-08-04 06:19 Patched (there is still old revision available for Linux on daily snapshot pages) and it works now.