RE: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-26 Thread George Birbilis
  (problem may
  be that they did their own codefolding - not sure which one works
  better)

 How is code folding called in synedit? I can't find it.

Search the unihighlighter.com forum for folding and for codefolding to
see post by the unihighlighter author regarding the mystix project (or
something like that) having added codefolding to SynEdit2.x. If you can't
find it you can try posting at that forum and ask where the codefolding is
(if it's in the official synedit distro or not)

They have a synmix download at that site, maybe the codefolding is in that
one


George Birbilis ([EMAIL PROTECTED])
Microsoft MVP J# for 2004-2006
Borland Spirit of Delphi
* QuickTime, QTVR, ActiveX, .NET, Delphi VCL, XML, IPC
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): 0630-2, 26/07/2006
Tested on: 26/7/2006 7:54:00 ??
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


RE: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-26 Thread George Birbilis
   How is code folding called in synedit? I can't find it.
  They don;t have it IIRC, there is another project though that
  implements this. http://mystix.sourceforge.net

 On the web page is says, that everytime you change the text
 manually, you have to update the fold regions yourself. And
 looking at the code it seems to me, that every update
 traverses through all fold ranges. I wonder how much overhead
 this creates for big sources.

I'd expect an architecture for CodeFolders (components) similar to
Highlighters of SynEdit. Also a generic CodeFolder (that does highlighter
logic dynamically from a description file) similar to Unihighlighter

How's the Lazarus codefolding implemented currently? Is it for Pascal only
or does it allow easily defining other (tree) foldings?


George Birbilis ([EMAIL PROTECTED])
Microsoft MVP J# for 2004-2006
Borland Spirit of Delphi
* QuickTime, QTVR, ActiveX, .NET, Delphi VCL, XML, IPC
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): 0630-2, 26/07/2006
Tested on: 26/7/2006 7:56: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


RE: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-26 Thread George Birbilis

 On the web page is says, that everytime you change the text
 manually, you have to update the fold regions yourself. And
 looking at the code it seems to me, that every update
 traverses through all fold ranges. I wonder how much overhead
 this creates for big sources.




I assume you mean the following from
http://mystix.sourceforge.net/code_folding.html

Introduction
Mystix uses the SynEdit component that was changed by me to support the code
folding feature. It is based on the 2.0.1 version of the original component.
You can use it in your own software on the same license as the original
SynEdit.

Usage
To enable code folding, set SynEdit.CodeFolding.Enabled to True. Fold
regions can be added only at run-time. You can add fold regions directly to
SynEdit control or to the highlighter. Which does apply is controled by the
CodeFolding.UseHighlighterFoldRegions property. First method that need to be
called after adding fold regions is InitCodeFolding. After that you only
need to call RescanForFoldRegions if you modify the buffer directly (eg. you
add some lines, or modify the SynEdit.Text property somehow). You should use
SynEdit.GetUncollapsedStrings function instead of SynEdit.Lines property.


--- it seems to also answer my question a bit, on whether they have
CodeFolders components. They seem to allow one to add fold regions to the
highlighter, not sure if new highlighters can automatically do it (make the
regions)



  _  

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


Virus Database (VPS): 0630-2, 26/07/2006
Tested on: 26/7/2006 8:01:19 ??
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


Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-26 Thread Mattias Gaertner
On Wed, 26 Jul 2006 19:56:46 +0300
George Birbilis [EMAIL PROTECTED] wrote:

How is code folding called in synedit? I can't find it.
   They don;t have it IIRC, there is another project though that
   implements this. http://mystix.sourceforge.net
 
  On the web page is says, that everytime you change the text
  manually, you have to update the fold regions yourself. And
  looking at the code it seems to me, that every update
  traverses through all fold ranges. I wonder how much overhead
  this creates for big sources.
 
 I'd expect an architecture for CodeFolders (components) similar to
 Highlighters of SynEdit. Also a generic CodeFolder (that does highlighter
 logic dynamically from a description file) similar to Unihighlighter
 
 How's the Lazarus codefolding implemented currently? Is it for Pascal only
 or does it allow easily defining other (tree) foldings?

The codefolding is done by the highlighters.
At the moment only the pascal highlighter is using it.
Extending other highlighters is quite easy. Ten lines plus one line for
every start and end.

Mattias


 
 
 George Birbilis ([EMAIL PROTECTED])
 Microsoft MVP J# for 2004-2006
 Borland Spirit of Delphi
 * QuickTime, QTVR, ActiveX, .NET, Delphi VCL, XML, IPC
 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): 0630-2, 26/07/2006
 Tested on: 26/7/2006 7:56: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

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


RE: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-25 Thread George Birbilis
A question then is if the highlighters work OK with Unicode. Not sure.
For example is AnsiUpperCase UNICODE-safe?



  All other IDE functions are using UTF-8 strings. They often
 assign big
  parts of the synedit lines. Assigning ansistrings is fast. But a
  widestring synedit must either convert everything on the
 fly or keep
  additional all strings as UTF-8.
  What about the official synedit? Does it support UTF-8?

 The UniSynEdit page has a link that explains the Unicode
 issues and which helper functions they added for Unicode,
 plus which functions of Delphi need to not be used when
 porting to Unicode some app and what other changes are usually needed

 In any case, I'd suggest trying to contribute the Lazarus
 enchancements (apart from the UTF-8 stuff) to the latest
 SynEdit core (the UniSynEdit is supposed to keep in sync with
 it) and contribute the UTF-8 stuff to the UniSynEdit project
 for comparison with their version and consideration of which
 approach is better/faster if they differ in the handling of Unicode




  _  

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


Virus Database (VPS): 0630-1, 24/07/2006
Tested on: 25/7/2006 10:35:31 p?
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


RE: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-25 Thread George Birbilis
 About 2:
 The whole Lazarus IDE works with strings, not widestring.
 The LCL will use strings, because that is more compatible to
 existing code.
 Existing LCL applications using synedit uses strings.

 It seems to me, we should merge with the normal synedit,
 instead of unisynedit. But maybe I missed a point?

Maybe they want to keep both an ANSI SynEdit and a Unicode SynEdit. In that
case if Lazarus one is Unicode only it should contribute to the UniSynEdit
all Unicode stuff and to both SynEdit and UniSynEdit the rest (problem may
be that they did their own codefolding - not sure which one works better)


George Birbilis ([EMAIL PROTECTED])
Microsoft MVP J# for 2004-2006
Borland Spirit of Delphi
* QuickTime, QTVR, ActiveX, .NET, Delphi VCL, XML, IPC
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): 0630-1, 24/07/2006
Tested on: 25/7/2006 10:41:03 p?
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


Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-25 Thread Mattias Gaertner
On Tue, 25 Jul 2006 10:35:33 +0300
George Birbilis [EMAIL PROTECTED] wrote:

 A question then is if the highlighters work OK with Unicode. Not sure.
 For example is AnsiUpperCase UNICODE-safe?

Yes, if the installed widestringmanager handles strings as UTF-8.
AFAIK, it does not yet.
Has FPC already an UTF-8 uppercase function?

Mattias


 
 
 
   All other IDE functions are using UTF-8 strings. They often
  assign big
   parts of the synedit lines. Assigning ansistrings is fast. But a
   widestring synedit must either convert everything on the
  fly or keep
   additional all strings as UTF-8.
   What about the official synedit? Does it support UTF-8?
 
  The UniSynEdit page has a link that explains the Unicode
  issues and which helper functions they added for Unicode,
  plus which functions of Delphi need to not be used when
  porting to Unicode some app and what other changes are usually needed
 
  In any case, I'd suggest trying to contribute the Lazarus
  enchancements (apart from the UTF-8 stuff) to the latest
  SynEdit core (the UniSynEdit is supposed to keep in sync with
  it) and contribute the UTF-8 stuff to the UniSynEdit project
  for comparison with their version and consideration of which
  approach is better/faster if they differ in the handling of Unicode
 
 
 
 
   _  
 
 avast! Antivirus http://www.avast.com : Outbound message clean. 
 
 
 Virus Database (VPS): 0630-1, 24/07/2006
 Tested on: 25/7/2006 10:35:31 p?
 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

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


Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-25 Thread Mattias Gaertner
On Tue, 25 Jul 2006 10:41:05 +0300
George Birbilis [EMAIL PROTECTED] wrote:

  About 2:
  The whole Lazarus IDE works with strings, not widestring.
  The LCL will use strings, because that is more compatible to
  existing code.
  Existing LCL applications using synedit uses strings.
 
  It seems to me, we should merge with the normal synedit,
  instead of unisynedit. But maybe I missed a point?
 
 Maybe they want to keep both an ANSI SynEdit and a Unicode SynEdit. In
that
 case if Lazarus one is Unicode only it should contribute to the UniSynEdit
 all Unicode stuff and to both SynEdit and UniSynEdit the rest

The Unicode stuff is UTF-8. Completely incompatible to Unicode with
widestrings.


 (problem may
 be that they did their own codefolding - not sure which one works better)

How is code folding called in synedit? I can't find it.


Mattias

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


Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-25 Thread Darius Blaszijk


- Original Message - 
From: Mattias Gaertner [EMAIL PROTECTED]

To: lazarus@miraclec.com
Sent: Tuesday, July 25, 2006 9:59 AM
Subject: Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps 
problem)




On Tue, 25 Jul 2006 10:41:05 +0300
George Birbilis [EMAIL PROTECTED] wrote:


 About 2:
 The whole Lazarus IDE works with strings, not widestring.
 The LCL will use strings, because that is more compatible to
 existing code.
 Existing LCL applications using synedit uses strings.

 It seems to me, we should merge with the normal synedit,
 instead of unisynedit. But maybe I missed a point?

Maybe they want to keep both an ANSI SynEdit and a Unicode SynEdit. In

that
case if Lazarus one is Unicode only it should contribute to the 
UniSynEdit

all Unicode stuff and to both SynEdit and UniSynEdit the rest


The Unicode stuff is UTF-8. Completely incompatible to Unicode with
widestrings.



(problem may
be that they did their own codefolding - not sure which one works better)


How is code folding called in synedit? I can't find it.
They don;t have it IIRC, there is another project though that implements 
this. http://mystix.sourceforge.net


Darius




Mattias

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


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


Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-25 Thread Mattias Gaertner
On Tue, 25 Jul 2006 10:08:37 +0200
Darius Blaszijk [EMAIL PROTECTED] wrote:

 
 - Original Message - 
 From: Mattias Gaertner [EMAIL PROTECTED]
 To: lazarus@miraclec.com
 Sent: Tuesday, July 25, 2006 9:59 AM
 Subject: Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps 
 problem)
 
 
  On Tue, 25 Jul 2006 10:41:05 +0300
  George Birbilis [EMAIL PROTECTED] wrote:
 
   About 2:
   The whole Lazarus IDE works with strings, not widestring.
   The LCL will use strings, because that is more compatible to
   existing code.
   Existing LCL applications using synedit uses strings.
  
   It seems to me, we should merge with the normal synedit,
   instead of unisynedit. But maybe I missed a point?
 
  Maybe they want to keep both an ANSI SynEdit and a Unicode SynEdit. In
  that
  case if Lazarus one is Unicode only it should contribute to the 
  UniSynEdit
  all Unicode stuff and to both SynEdit and UniSynEdit the rest
 
  The Unicode stuff is UTF-8. Completely incompatible to Unicode with
  widestrings.
 
 
  (problem may
  be that they did their own codefolding - not sure which one works
better)
 
  How is code folding called in synedit? I can't find it.
 They don;t have it IIRC, there is another project though that implements 
 this. http://mystix.sourceforge.net

On the web page is says, that everytime you change the text manually, you
have to update the fold regions yourself. And looking at the code it seems
to me, that every update traverses through all fold ranges. I wonder how
much overhead this creates for big sources.


Mattias

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


Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-24 Thread Mattias Gaertner
On Mon, 24 Jul 2006 14:36:20 +1100
Alexander Klenin [EMAIL PROTECTED] wrote:

 On 7/23/06, Mattias Gaertner [EMAIL PROTECTED] wrote:
   I have recently started poking around it and have some ideas ;-)
 
  What ideas?
 Well, for starters, the code obviously will benefit from some refactoring.
 E.g. mouse links processing is spread over many different places,
 with some literally duplicating code.

ok


 The interface of syntax highlighters needs improvement also.
 I tried to disable mouselinks over keywords and numbers (because
 clicking them will always lead to error). I have found the following:
 one the one hand, IsKeyword function defined in basic class is not
 implemented in descendants,
 on the other hand, GetToken function, seemingly designed to return
 the type of the current token, returns unadorned integer, with no way
 to interpret it, and GetTokenID function, which does return enumerated
 type, is pascal-specific.
 Is the above worth fixing?

Sure.
GetToken: it *is* an unadorned PtrInt. Only the highlighter knows, what it
means. With codefolding it can be a pointer.

I see two ways to find out if a word is an identifier: 
a) Let the highlighter parse the line to the word under cursor and add a
function to highlighter 'IsIdentifier'. Disadvantage: It will still
highlight words of non pascal.
b) add an event to synedit OnWordHasLink(Sender,Line,Col): boolean. The IDE
can then examine the word and it knows better what can be used as link and
what not.


Mattias

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


Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-24 Thread Mattias Gaertner
On Sun, 23 Jul 2006 21:05:44 +0300
George Birbilis [EMAIL PROTECTED] wrote:

  All other IDE functions are using UTF-8 strings. They often
  assign big parts of the synedit lines. Assigning ansistrings
  is fast. But a widestring synedit must either convert
  everything on the fly or keep additional all strings as UTF-8.
  What about the official synedit? Does it support UTF-8?
 
 The UniSynEdit page has a link that explains the Unicode issues and which
 helper functions they added for Unicode, plus which functions of Delphi
need
 to not be used when porting to Unicode some app and what other changes are
 usually needed
 
 In any case, I'd suggest trying to contribute the Lazarus enchancements
 (apart from the UTF-8 stuff) to the latest SynEdit core (the UniSynEdit is
 supposed to keep in sync with it) and contribute the UTF-8 stuff to the
 UniSynEdit project for comparison with their version and consideration of
 which approach is better/faster if they differ in the handling of Unicode

The speed difference is not very important. At least the UTF-8 additions
made synedit hardly slower. And both UTF-8 and UTF-16 support the full
unicode.

IMO the goal is to
1. add most of the lazarus additions to the official synedit
2. replace the lazarus synedit with the official synedit and keep in sync,
so that both projects gain

About 1:
Basically the wepage of UniSynEdit says, it 'only' adds widestring and many
widestrings unicode functions to the normal synedit. Is this correct?
If yes, then the lazarus additions should be added to synedit and then to
unisynedit.

About 2:
The whole Lazarus IDE works with strings, not widestring.
The LCL will use strings, because that is more compatible to existing code.
Existing LCL applications using synedit uses strings.

It seems to me, we should merge with the normal synedit, instead of
unisynedit. But maybe I missed a point?


Mattias

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


Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-23 Thread Mattias Gaertner
On Sun, 23 Jul 2006 14:54:49 +1100
Alexander Klenin [EMAIL PROTECTED] wrote:

 On 7/22/06, George Birbilis [EMAIL PROTECTED] wrote:
  I haven't tried SynEdit 2.x and the new Unihighlighter yet, but sometime
in
  the future when I do, I'll see what it takes to port the to Lazarus
(seeing
  what changes had been done to old SynEdit to port it)
 
 Does that mean that there is no point in enhancing the SysEdit which
 is now in Lazarus?
 I have recently started poking around it and have some ideas ;-)

What ideas?

Mattias
 

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


Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-23 Thread Darius Blaszijk

Question about SynEdit: I know the lazarus version is a very
customized one from old source... Will it be replaced by a newer
version from the original project?


Yes, eventually.


Mattias,

I'm willing to try to port UniSynEdit to Lazarus (and keep it in sync with 
their trunk), however how do you feel about that. I know you have your 
doubts about certain parts of the code (can't remember anymore what though 
precisely). Would it be sensible then to start something like this? Or is 
there another component that will be a better candidate to be used in the 
sourceeditor eventually. Or do you feel that a completely new component 
should be developed purely for Lazarus source editor which is highly 
optimized just for that task and is integrated at it's best in Lazarus. What 
are the properties such a component at least should have?


Darius 


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


Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-23 Thread Mattias Gaertner
On Sun, 23 Jul 2006 10:22:00 +0200
Darius Blaszijk [EMAIL PROTECTED] wrote:

  Question about SynEdit: I know the lazarus version is a very
  customized one from old source... Will it be replaced by a newer
  version from the original project?
 
  Yes, eventually.
 
 Mattias,
 
 I'm willing to try to port UniSynEdit to Lazarus (and keep it in sync with

 their trunk), however how do you feel about that. I know you have your 
 doubts about certain parts of the code (can't remember anymore what though

 precisely). Would it be sensible then to start something like this? Or is 
 there another component that will be a better candidate to be used in the 
 sourceeditor eventually. Or do you feel that a completely new component 
 should be developed purely for Lazarus source editor which is highly 
 optimized just for that task and is integrated at it's best in Lazarus.
What 
 are the properties such a component at least should have?

Here is a list, what features has been added to synedit.

- LCL support (not just compile. using less messages, but methods)
- UTF-8 support
- bidi support
- fast enough to open and edit fpcmacosall.pas
- 64bit support
- Options:
 eoBracketHighlight,// Highlight matching bracket
 eoDoubleClickSelectsLine,  // Select line on double click
 eoHideRightMargin, // Hides the right margin line
 eoPersistentCaret, // Do not hide caret when focus lost
 eoShowCtrlMouseLinks,  // Pressing Ctrl will highlight the word under
the mouse cursor
 eoAutoIndentOnPaste,   // Indent text inserted from clipboard
 eoSpacesToTabs // Converts space characters to tabs and spaces
 eoCaretSkipsSelection, // Caret skips selection on VK_LEFT/VK_RIGHT
 eoAlwaysVisibleCaret   // Move caret to be always visible when
scrolling
- Support for primary selection (middle mouse click under X)
- property BlockIndent: integer
- procedure SelectToBrace;
- procedure SelectLine;
- procedure SelectParagraph;
- property SelStart: Integer
- property SelEnd: Integer
- code folding
- the TSynPasSyn has some extensions too.
- syncompletion.pas contains a lot of additions. But nowadays I would
rewrite the whole unit. The IDE already positions and paints the completion
box. Therefore the new synedit just needs to provide some hooks and I will
write a new completion box for the IDE. I want to extend it anyway.

Of course the identifiers can be renamed and some features could work a
little bit different. 
And: This time keep in sync with the official synedit with {$IFDEF LCL}.

I didn't take a closer look at unisynedit. What are the differences to the
old synedit?


Mattias

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


Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-23 Thread Darius Blaszijk


- Original Message - 
From: Mattias Gaertner [EMAIL PROTECTED]

To: lazarus@miraclec.com
Sent: Sunday, July 23, 2006 12:27 PM
Subject: Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps 
problem)




On Sun, 23 Jul 2006 10:22:00 +0200
Darius Blaszijk [EMAIL PROTECTED] wrote:


 Question about SynEdit: I know the lazarus version is a very
 customized one from old source... Will it be replaced by a newer
 version from the original project?

 Yes, eventually.

Mattias,

I'm willing to try to port UniSynEdit to Lazarus (and keep it in sync 
with



their trunk), however how do you feel about that. I know you have your
doubts about certain parts of the code (can't remember anymore what 
though



precisely). Would it be sensible then to start something like this? Or is
there another component that will be a better candidate to be used in the
sourceeditor eventually. Or do you feel that a completely new component
should be developed purely for Lazarus source editor which is highly
optimized just for that task and is integrated at it's best in Lazarus.

What

are the properties such a component at least should have?


Here is a list, what features has been added to synedit.

- LCL support (not just compile. using less messages, but methods)
- UTF-8 support
- bidi support
- fast enough to open and edit fpcmacosall.pas
- 64bit support
- Options:
eoBracketHighlight,// Highlight matching bracket
eoDoubleClickSelectsLine,  // Select line on double click
eoHideRightMargin, // Hides the right margin line
eoPersistentCaret, // Do not hide caret when focus lost
eoShowCtrlMouseLinks,  // Pressing Ctrl will highlight the word under
the mouse cursor
eoAutoIndentOnPaste,   // Indent text inserted from clipboard
eoSpacesToTabs // Converts space characters to tabs and spaces
eoCaretSkipsSelection, // Caret skips selection on VK_LEFT/VK_RIGHT
eoAlwaysVisibleCaret   // Move caret to be always visible when
scrolling
- Support for primary selection (middle mouse click under X)
- property BlockIndent: integer
- procedure SelectToBrace;
- procedure SelectLine;
- procedure SelectParagraph;
- property SelStart: Integer
- property SelEnd: Integer
- code folding
- the TSynPasSyn has some extensions too.
- syncompletion.pas contains a lot of additions. But nowadays I would
rewrite the whole unit. The IDE already positions and paints the 
completion

box. Therefore the new synedit just needs to provide some hooks and I will
write a new completion box for the IDE. I want to extend it anyway.

Of course the identifiers can be renamed and some features could work a
little bit different.
And: This time keep in sync with the official synedit with {$IFDEF LCL}.

I didn't take a closer look at unisynedit. What are the differences to the
old synedit?
As far as I can tell based on the comparison of a few units, it seems that 
all strings are now declared as widestring. and chars are now widechar or 
ansichar. There's a new unit SynUnicode.pas that implements widestring 
objects. For the rest it looks pretty much the same as the CVS version.


Darius




Mattias

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


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


Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-23 Thread Mattias Gaertner
On Sun, 23 Jul 2006 13:42:59 +0200
Darius Blaszijk [EMAIL PROTECTED] wrote:

 
 - Original Message - 
 From: Mattias Gaertner [EMAIL PROTECTED]
 To: lazarus@miraclec.com
 Sent: Sunday, July 23, 2006 12:27 PM
 Subject: Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps 
 problem)
 
 
  On Sun, 23 Jul 2006 10:22:00 +0200
  Darius Blaszijk [EMAIL PROTECTED] wrote:
 
   Question about SynEdit: I know the lazarus version is a very
   customized one from old source... Will it be replaced by a newer
   version from the original project?
  
   Yes, eventually.
 
  Mattias,
 
  I'm willing to try to port UniSynEdit to Lazarus (and keep it in sync 
  with
 
  their trunk), however how do you feel about that. I know you have your
  doubts about certain parts of the code (can't remember anymore what 
  though
 
  precisely). Would it be sensible then to start something like this? Or
is
  there another component that will be a better candidate to be used in
the
  sourceeditor eventually. Or do you feel that a completely new component
  should be developed purely for Lazarus source editor which is highly
  optimized just for that task and is integrated at it's best in Lazarus.
  What
  are the properties such a component at least should have?
 
  Here is a list, what features has been added to synedit.
 
  - LCL support (not just compile. using less messages, but methods)
  - UTF-8 support
  - bidi support
  - fast enough to open and edit fpcmacosall.pas
  - 64bit support
  - Options:
  eoBracketHighlight,// Highlight matching bracket
  eoDoubleClickSelectsLine,  // Select line on double click
  eoHideRightMargin, // Hides the right margin line
  eoPersistentCaret, // Do not hide caret when focus lost
  eoShowCtrlMouseLinks,  // Pressing Ctrl will highlight the word
under
  the mouse cursor
  eoAutoIndentOnPaste,   // Indent text inserted from clipboard
  eoSpacesToTabs // Converts space characters to tabs and
spaces
  eoCaretSkipsSelection, // Caret skips selection on VK_LEFT/VK_RIGHT
  eoAlwaysVisibleCaret   // Move caret to be always visible when
  scrolling
  - Support for primary selection (middle mouse click under X)
  - property BlockIndent: integer
  - procedure SelectToBrace;
  - procedure SelectLine;
  - procedure SelectParagraph;
  - property SelStart: Integer
  - property SelEnd: Integer
  - code folding
  - the TSynPasSyn has some extensions too.
  - syncompletion.pas contains a lot of additions. But nowadays I would
  rewrite the whole unit. The IDE already positions and paints the 
  completion
  box. Therefore the new synedit just needs to provide some hooks and I
will
  write a new completion box for the IDE. I want to extend it anyway.
 
  Of course the identifiers can be renamed and some features could work a
  little bit different.
  And: This time keep in sync with the official synedit with {$IFDEF LCL}.
 
  I didn't take a closer look at unisynedit. What are the differences to
the
  old synedit?
 As far as I can tell based on the comparison of a few units, it seems that

 all strings are now declared as widestring. and chars are now widechar or 
 ansichar. There's a new unit SynUnicode.pas that implements widestring 
 objects. For the rest it looks pretty much the same as the CVS version.

All other IDE functions are using UTF-8 strings. They often assign big parts
of the synedit lines. Assigning ansistrings is fast. But a widestring
synedit must either convert everything on the fly or keep additional all
strings as UTF-8.
What about the official synedit? Does it support UTF-8?


Mattias

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


RE: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-23 Thread George Birbilis
 All other IDE functions are using UTF-8 strings. They often
 assign big parts of the synedit lines. Assigning ansistrings
 is fast. But a widestring synedit must either convert
 everything on the fly or keep additional all strings as UTF-8.
 What about the official synedit? Does it support UTF-8?

The UniSynEdit page has a link that explains the Unicode issues and which
helper functions they added for Unicode, plus which functions of Delphi need
to not be used when porting to Unicode some app and what other changes are
usually needed

In any case, I'd suggest trying to contribute the Lazarus enchancements
(apart from the UTF-8 stuff) to the latest SynEdit core (the UniSynEdit is
supposed to keep in sync with it) and contribute the UTF-8 stuff to the
UniSynEdit project for comparison with their version and consideration of
which approach is better/faster if they differ in the handling of Unicode


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-2, 21/07/2006
Tested on: 23/7/2006 9:02:48 ??
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


RE: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-23 Thread George Birbilis
It seems the fixes I sent to SynUniHighlighter.pas where correct, but didn't
fix the original problem (SynEdit writing only caps), one of my colleagues I
had asked to test my changes found it and did this extra fix:

TL 2003-06-12: Added the following to satisfy abstract method override
{$IFDEF SYN_LAZARUS}
procedure TSynUniSyn.GetTokenEx(var TokenStart: PChar;
  var TokenLength: integer);
begin
  TokenLength:=Run-fTokenPos;

  //
  // mmt  2006-07-23 : changed FLine in the following
  // TokenStart:=FLine + fTokenPos;
  // to FTrueLine
  //
  TokenStart:=FTrueLine + fTokenPos;
end;
{$ENDIF}

It needed FTrueLine instead of FLine there

Will ask them to send me a Diff for UniHighlighter.pas using TortoiseSVN and
submit it



Btw, there does exist a SynUniDesigner.pas unitat the Lazarus port


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: Saturday, July 22, 2006 2:37 AM
 To: lazarus@miraclec.com
 Subject: RE: [lazarus] SynEdit + Unihighlighter (must have
 fixed caps problem)

   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;
 
  Where is this TSynUniEditor?

 If that one is missing at the Lazarus port, the respective
 line should be commented out
  
   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.
 
  Will you create a patch?

 Still waiting to see if others can try it and see if it works
 (I only compared the sources with WinDiff, haven't got time
 currently to test it)

 Not sure how to make a patch btw, is there some builtin tool
 at lazarus to make Diffs or similar? Or does one use

Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-23 Thread Alexander Klenin

On 7/23/06, Mattias Gaertner [EMAIL PROTECTED] wrote:

 I have recently started poking around it and have some ideas ;-)

What ideas?

Well, for starters, the code obviously will benefit from some refactoring.
E.g. mouse links processing is spread over many different places,
with some literally duplicating code.
The interface of syntax highlighters needs improvement also.
I tried to disable mouselinks over keywords and numbers (because
clicking them will always lead to error). I have found the following:
one the one hand, IsKeyword function defined in basic class is not
implemented in descendants,
on the other hand, GetToken function, seemingly designed to return
the type of the current token, returns unadorned integer, with no way
to interpret it, and GetTokenID function, which does return enumerated
type, is pascal-specific.
Is the above worth fixing?

--
Alexander S. Klenin
Insight Experts Ltd.

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


Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-22 Thread Mattias Gaertner
On Fri, 21 Jul 2006 20:21:57 -0400
Alexandre Leclerc [EMAIL PROTECTED] wrote:

 2006/7/21, George Birbilis [EMAIL PROTECTED]:
  Not sure how to make a patch btw, is there some builtin tool at lazarus
to
  make Diffs or similar? Or does one use TortoiseCVS menu to do the Diff?
 
 Yes, use TortoiseSVN diff tool.
 
 Question about SynEdit: I know the lazarus version is a very
 customized one from old source... Will it be replaced by a newer
 version from the original project?

Yes, eventually. 


 (i.e. does the original project now support FPC compiler and lazarus)

The FPC compiler: Yes, of course
Lazarus: I don't know.


Mattias

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


RE: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-22 Thread George Birbilis
  (i.e. does the original project now support FPC compiler
 and lazarus)

 The FPC compiler: Yes, of course
 Lazarus: I don't know.

Since it's a VCL control how can this be? Is there other VCL library for FPC
too?


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-2, 21/07/2006
Tested on: 22/7/2006 1:10:22 ??
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


RE: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-22 Thread George Birbilis
  Not sure how to make a patch btw, is there some builtin tool at
  lazarus to make Diffs or similar? Or does one use
 TortoiseCVS menu to do the Diff?

 Yes, use TortoiseSVN diff tool.

 Question about SynEdit: I know the lazarus version is a very
 customized one from old source... Will it be replaced by a
 newer version from the original project (i.e. does the
 original project now support FPC compiler and lazarus)?

Can find links to latest SynEdit (2.x) at unihighlighter.com. It seems
there's a project called Mystix that also updated it to have Code Folding (I
know some people were asking about the Lazarus code folding). Also there's
updates to UniSynEdit (Unicode SynEdit) etc. Strangely enough, the
synedit.sf.net site has the old SynEdit only. Same goes for Unihighlighter,
the  http://www.delphist.com/UniHighlighter.html site has the old one (the
one Lazarus port used) and www.unihighlighter.com has the new one.

I haven't tried SynEdit 2.x and the new Unihighlighter yet, but sometime in
the future when I do, I'll see what it takes to port the to Lazarus (seeing
what changes had been done to old SynEdit to port it)


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-2, 21/07/2006
Tested on: 22/7/2006 1:07:30 ??
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


Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-22 Thread Mattias Gaertner
On Sat, 22 Jul 2006 13:10:23 +0300
George Birbilis [EMAIL PROTECTED] wrote:

   (i.e. does the original project now support FPC compiler
  and lazarus)
 
  The FPC compiler: Yes, of course
  Lazarus: I don't know.
 
 Since it's a VCL control how can this be? Is there other VCL library for
FPC
 too?

VCL  Delphi compiler.

I never tried, but I heard, FPC can compile the VCL and the CLX.

Mattias


 
 
 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-2, 21/07/2006
 Tested on: 22/7/2006 1:10:22 ??
 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

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


Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-22 Thread Michael Van Canneyt


On Sat, 22 Jul 2006, Mattias Gaertner wrote:

 On Sat, 22 Jul 2006 13:10:23 +0300
 George Birbilis [EMAIL PROTECTED] wrote:
 
(i.e. does the original project now support FPC compiler
   and lazarus)
  
   The FPC compiler: Yes, of course
   Lazarus: I don't know.
  
  Since it's a VCL control how can this be? Is there other VCL library for
 FPC
  too?
 
 VCL  Delphi compiler.
 
 I never tried, but I heard, FPC can compile the VCL and the CLX.

It can compile the CLX, except for some Midas stuff.
In fact, this is what allows projects such as CrossFPC to work...

Michael.

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


Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-22 Thread Darius Blaszijk
The next generation SynEdit component seems to be unisynedit 
(http://mh-nexus.de/unisynedit.htm). I have never used it though so I can't 
comment on how useable it is.


Darius

- Original Message - 
From: George Birbilis [EMAIL PROTECTED]

To: lazarus@miraclec.com
Sent: Saturday, July 22, 2006 12:10 PM
Subject: RE: [lazarus] SynEdit + Unihighlighter (must have fixed caps 
problem)




 Not sure how to make a patch btw, is there some builtin tool at
 lazarus to make Diffs or similar? Or does one use
TortoiseCVS menu to do the Diff?

Yes, use TortoiseSVN diff tool.

Question about SynEdit: I know the lazarus version is a very
customized one from old source... Will it be replaced by a
newer version from the original project (i.e. does the
original project now support FPC compiler and lazarus)?


Can find links to latest SynEdit (2.x) at unihighlighter.com. It seems
there's a project called Mystix that also updated it to have Code Folding 
(I

know some people were asking about the Lazarus code folding). Also there's
updates to UniSynEdit (Unicode SynEdit) etc. Strangely enough, the
synedit.sf.net site has the old SynEdit only. Same goes for 
Unihighlighter,

the  http://www.delphist.com/UniHighlighter.html site has the old one (the
one Lazarus port used) and www.unihighlighter.com has the new one.

I haven't tried SynEdit 2.x and the new Unihighlighter yet, but sometime 
in
the future when I do, I'll see what it takes to port the to Lazarus 
(seeing

what changes had been done to old SynEdit to port it)


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-2, 21/07/2006
Tested on: 22/7/2006 1:07:30 ??
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 


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


Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-22 Thread Mattias Gaertner
On Sat, 22 Jul 2006 13:10:23 +0300
George Birbilis [EMAIL PROTECTED] wrote:

   Not sure how to make a patch btw, is there some builtin tool at
   lazarus to make Diffs or similar? Or does one use
  TortoiseCVS menu to do the Diff?
 
  Yes, use TortoiseSVN diff tool.
 
  Question about SynEdit: I know the lazarus version is a very
  customized one from old source... Will it be replaced by a
  newer version from the original project (i.e. does the
  original project now support FPC compiler and lazarus)?
 
 Can find links to latest SynEdit (2.x) at unihighlighter.com. It seems
 there's a project called Mystix that also updated it to have Code Folding
(I
 know some people were asking about the Lazarus code folding).

If it is only code folding: It is nearly complete. There are a few places
left, which needs fixing.


 Also there's
 updates to UniSynEdit (Unicode SynEdit) etc. Strangely enough, the
 synedit.sf.net site has the old SynEdit only.

Thanks to Mazen lazarus synedit supports even bidi. Compile with
-dUSE_UTF8BIDI_LCL.


 Same goes for Unihighlighter,
 the  http://www.delphist.com/UniHighlighter.html site has the old one (the
 one Lazarus port used) and www.unihighlighter.com has the new one.

Does it use widestrings?

 
 I haven't tried SynEdit 2.x and the new Unihighlighter yet, but sometime
in
 the future when I do, I'll see what it takes to port the to Lazarus
(seeing
 what changes had been done to old SynEdit to port it)

Great.


Mattias

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


RE: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-22 Thread George Birbilis
Indeed, that page has recent date at its end, but it seems the non-Unicode
(ANSI) SynEdit is updates as well at synedit.sf.net (see Downloads section
for 2.0.3 stable release). The problem seems to be that the news section at
the home page of synedit.sf.net is VERY VERY old and makes one believe the
project is dead


 The next generation SynEdit component seems to be
 unisynedit (http://mh-nexus.de/unisynedit.htm). I have never
 used it though so I can't comment on how useable it is.

 Darius

 - Original Message -
 From: George Birbilis [EMAIL PROTECTED]
 To: lazarus@miraclec.com
 Sent: Saturday, July 22, 2006 12:10 PM
 Subject: RE: [lazarus] SynEdit + Unihighlighter (must have fixed caps
 problem)


   Not sure how to make a patch btw, is there some builtin tool at
   lazarus to make Diffs or similar? Or does one use
  TortoiseCVS menu to do the Diff?
 
  Yes, use TortoiseSVN diff tool.
 
  Question about SynEdit: I know the lazarus version is a very
  customized one from old source... Will it be replaced by a newer
  version from the original project (i.e. does the original
 project now
  support FPC compiler and lazarus)?
 
  Can find links to latest SynEdit (2.x) at
 unihighlighter.com. It seems
  there's a project called Mystix that also updated it to have Code
  Folding (I know some people were asking about the Lazarus code
  folding). Also there's updates to UniSynEdit (Unicode SynEdit) etc.
  Strangely enough, the synedit.sf.net site has the old SynEdit only.
  Same goes for Unihighlighter, the 
  http://www.delphist.com/UniHighlighter.html site has the
 old one (the
  one Lazarus port used) and www.unihighlighter.com has the new one.
 
  I haven't tried SynEdit 2.x and the new Unihighlighter yet, but
  sometime in the future when I do, I'll see what it takes to
 port the
  to Lazarus (seeing what changes had been done to old
 SynEdit to port
  it)
 
  
  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-2, 21/07/2006 Tested on:
 22/7/2006 1:07:30
  ??
  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

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



  _  

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


Virus Database (VPS): 0629-2, 21/07/2006
Tested on: 22/7/2006 4:27:29 ??
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


Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-22 Thread Alexander Klenin

On 7/22/06, George Birbilis [EMAIL PROTECTED] wrote:

I haven't tried SynEdit 2.x and the new Unihighlighter yet, but sometime in
the future when I do, I'll see what it takes to port the to Lazarus (seeing
what changes had been done to old SynEdit to port it)


Does that mean that there is no point in enhancing the SysEdit which
is now in Lazarus?
I have recently started poking around it and have some ideas ;-)

--
Alexander S. Klenin
Insight Experts Ltd.

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


Re: [lazarus] SynEdit + Unihighlighter

2006-07-21 Thread dhkblaszyk
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.

Darius


 Some colleagues tell me they found a Unihighlighter in Lazarus that's
 quite
 different from the one at unihighlighter.sf.net (I don't suppose it's the
 newer one from unihighlighter.com). It doesn't seem to work OK (they tried
 with the Lazarus version of SynEdit). Whatever they type-in shows in
 capital
 case

 Has anyone else used it?

 
 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 3:03:58 ??
 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



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


RE: [lazarus] SynEdit + Unihighlighter

2006-07-21 Thread George Birbilis
 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 4:20:52 ??
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


RE: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-21 Thread George Birbilis
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: lazarus@miraclec.com
 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


Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-21 Thread Mattias Gaertner
On Fri, 21 Jul 2006 17:39:59 +0300
George Birbilis [EMAIL PROTECTED] wrote:

 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;

Where is this TSynUniEditor?

 
 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.

Will you create a patch?


Mattias




 
 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: lazarus@miraclec.com
  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

RE: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-21 Thread George Birbilis
  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;

 Where is this TSynUniEditor?

If that one is missing at the Lazarus port, the respective line should be
commented out
  
  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.

 Will you create a patch?

Still waiting to see if others can try it and see if it works (I only
compared the sources with WinDiff, haven't got time currently to test it)

Not sure how to make a patch btw, is there some builtin tool at lazarus to
make Diffs or similar? Or does one use TortoiseCVS menu to do the Diff?


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-2, 21/07/2006
Tested on: 22/7/2006 2:27:58 p?
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


Re: [lazarus] SynEdit + Unihighlighter (must have fixed caps problem)

2006-07-21 Thread Alexandre Leclerc

2006/7/21, George Birbilis [EMAIL PROTECTED]:

Not sure how to make a patch btw, is there some builtin tool at lazarus to
make Diffs or similar? Or does one use TortoiseCVS menu to do the Diff?


Yes, use TortoiseSVN diff tool.

Question about SynEdit: I know the lazarus version is a very
customized one from old source... Will it be replaced by a newer
version from the original project (i.e. does the original project now
support FPC compiler and lazarus)?

--
Alexandre Leclerc

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