View Issue Details

IDProjectCategoryView StatusLast Update
0001496JEDI VCL00 JVCL Componentspublic2004-03-23 07:05
ReportermaxpAssigned Touser72 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0001496: JvHLEditor highlighter bug
DescriptionJvHLEditor incorrectly highlights pascal comments when
JvHlEditor.Lines.Assign(List) procedure is used. To reproduce this bug, create form with JvHlEditor and button.
Place the code in Botton.OnClick:

procedure TForm1.Button1Click(Sender: TObject);
var
  L: TStringList;
begin
  L := TStringList.Create;
  try
    L.Text :=
     '(*'^M^J +
     'procedure test;'^M^J +
     'begin'^M^J +
     'end;'^M^J +
     '*)'^M^J +
     'procedure test2;'^M^J +
     'begin'^M^J +
     'end;';
    JvHlEditor1.Lines.Assign(L);
  finally
    FreeAndNil(L);
  end;
end;

Run the application and press the button. Text inside (* *)
looks like uncommented.
Additional InformationChanging JvHlEditor1.Lines.Assign(L) to JvHlEditor1.Lines.Text := L.Text fixes this odd behaviour.
Probably bug is located in "JvHlEditor1.Lines.Assign".
TagsNo tags attached.

Activities

user72

2004-03-20 01:50

  ~0003404

Last edited: 2004-03-21 03:06

Try changing the following method in JvEditor.pas (changes in bold):

procedure TJvEditorStrings.Assign(Source: TPersistent);
begin
  JvEditor.BeginUpdate;
  try
    inherited Assign(Source);

    JvEditor.NotUndoable;
    JvEditor.TextAllChanged;

  finally
    JvEditor.EndUpdate;
  end;
end;

Does that fix it?

edited on: 03-21-04 03:06

maxp

2004-03-22 04:00

reporter   ~0003422

You are right, adding (**)JvEditor.TextAllChanged;(**) after
(**)JvEditor.TextAllChanged;(**) in TJvEditorStrings.Assign fixed this bug.

user72

2004-03-23 07:05

  ~0003446

Fixed in CVS

Issue History

Date Modified Username Field Change
2004-03-19 02:49 maxp New Issue
2004-03-20 01:50 user72 Note Added: 0003404
2004-03-20 01:50 user72 Status new => feedback
2004-03-21 03:06 user72 Note Edited: 0003404
2004-03-22 04:00 maxp Note Added: 0003422
2004-03-22 21:54 user72 Status feedback => assigned
2004-03-22 21:54 user72 Assigned To => user72
2004-03-23 07:05 user72 Status assigned => resolved
2004-03-23 07:05 user72 Resolution open => fixed
2004-03-23 07:05 user72 Note Added: 0003446