I think I found the problem:

1) at SynUniHighlighter.pas, the

procedure Register;
begin
  RegisterComponents('SynEdit', [TSynUniSyn]);
end;

Should be removed (was added by Tom). The component registration action is
repeated at SynUniReg.pas in a more correct way:

procedure Register;
begin
  RegisterComponents( SYNS_ComponentsPage, [TSynUniSyn] );
  RegisterComponentEditor(TSynUniSyn, TSynUniEditor);
end;

As you see, here it uses the SYNS_ComponentsPage constant of SynEdit for the
palette name. Users should open up and register SynUniReg.pas instead of
SynUniHighlighter.pas

2) at SynUniHighlighter.pas, Tom didn't need to do all those changes, he
could have used {$MODE DELPHI} instead. I suggest the original
SynUniHighlighter.pas is taken (it's the same version from which Tom made
the Lazarus port) from http://www.delphist.com/UniHighlighter.html and used
with {$MODE DELPHI}. In fact there's high chance all the stuff Tom couldn't
port (e.g. the designer) could be ported just by adding {$MODE DELPHI} in
the sources of that UniHighlighter version (don't get newer UniHighlighter
from UniHighlighter.com, don't think it works with SynEdit1.1, but only with
2.x)

3) the fix to the extisting SynUniHighlighter.pas that Tom made must be the
following (haven't tested it). Search for //Birb below (2 fixes):

function TNumberSymbols.GetToken(parser:TSynUniSyn; var
tkSynSymbol1:TSynSymbol): boolean;
begin
 repeat
   Inc(Parser.Run);
 until not (parser.fLine[parser.Run] in ['0'..'9']);
 if parser.fLine[parser.Run] in parser.fCurrentRule.fTermSymbols then
 begin
   Result:=True;
   tkSynSymbol1:=self.tkSynSymbol; //Birb: Tom had renamed the method
parameter in the signature to tkSynSymbol1, but forgot to rename it in the
code too
 end
 else
   Result:=false;
end;

function TDefaultTermSymbols.GetToken(parser: TSynUniSyn;var
tkSynSymbol1:TSynSymbol): boolean;
begin
  if parser.fLine[parser.Run]<>#0 then
     Inc(parser.Run);
  tkSynSymbol1:=self.tkSynSymbol; //Birb: Tom had renamed the method
parameter in the signature to tkSynSymbol1, but forgot to rename it in the
code too
  Result:=True;
end;

This bug would have been avoided if Tom did use {$MODE DELPHI} so that FPC
wouldn't complain of the tkSynSymbol method parameter as a duplicate (the
respective classes had a field with the same name which Delphi allows, but
FPC doesn't seem to if {$MODE DELPHI} isn't used)

*** Please try this fix (will tell my colleagues to try it too) and then
somebody add this to Lazarus sourcebase. Would be glad if someone lets me
know when new Lazarus with this fix is arround.

* Will also tell my colleagues to try porting all the unihighlighter distro
from http://www.delphist.com/UniHighlighter.html using Delphi compatibility
mode of FPC and let you know if they do it successfully (don't have time at
the moment to do it myself). If they make it we can put that one in Lazarus
instead of Tom's partial port I suppose, since FPC can mix Pascal files of
Delphi and non-Delphi mode OK.

cheers,
George

----------------
George Birbilis ([EMAIL PROTECTED])
Microsoft MVP J# for 2004-2006
Borland "Spirit of Delphi"
* QuickTime, QTVR, ActiveX, VCL, .NET
http://www.kagi.com/birbilis
* Robotics
http://www.mech.upatras.gr/~Robotics
http://www.mech.upatras.gr/~robgroup


> -----Original Message-----
> From: George Birbilis [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 21, 2006 4:21 PM
> To: [email protected]
> Subject: RE: [lazarus] SynEdit + Unihighlighter
>
> > I have the same captials for a Lisp editor I once made, but
> I thought
> > it was just a settings that wasn't correct. It didnt bother
> me at the
> > time.
>
> Afaik it's a showstopper for a project we have and will have
> to fix it myself most probably, that's why I'm asking if
> others have fixed this already...
>
> Seems to be based on 29-1-2003 build of Unihighlighter
> (http://www.delphist.com/UniHighlighter.html) and not on
> Unihighlighter.com's newer version, but that's the version of
> Unihighlighter I'm using anyway.
> I'll use WinDiff or ExamDiff to see what Tom changed when
> porting to Lazarus and see what he broke there to fix it
> (hope it's not a SynEdit Lazarus-port bug that only comes up
> when interating with Unihighlighter)
>
> ----------------
> George Birbilis ([EMAIL PROTECTED])
> Microsoft MVP J# for 2004-2006
> Borland "Spirit of Delphi"
> * QuickTime, QTVR, ActiveX, VCL, .NET
> http://www.kagi.com/birbilis
> * Robotics
> http://www.mech.upatras.gr/~Robotics
> http://www.mech.upatras.gr/~robgroup




  _____  

avast! Antivirus <http://www.avast.com> : Outbound message clean. 


Virus Database (VPS): 0629-1, 19/07/2006
Tested on: 21/7/2006 5:38:45 ??
avast! - copyright (c) 1988-2006 ALWIL Software.



_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to