Jump to content
MarkShark

SynEdit preferred version?

Recommended Posts

Hey all.  I use SynEdit in a few projects and I was wondering if anyone has insight on which of the various version is the preferred one to use.  I'm on 10.4 and don't need backwards compatibility btw.

 

The one that is on "GetIt" appears to be an older version (1.5.)

 

The one listed as SynEdit2 on github by pyscripter appears to be active, includes some nice changes (ole drag and drop for example) lots of fixes and cleanup (some related to removing support for older Delphi versions.)

 

The one listed as SynEdit/SynEdit on github which seems to be more actively developed then the other two.

 

I've worked with the second two and, as always, it seems when working with third party components I have to make a few changes to the source (adding some missing properties, fixing the extra space on word wrap lines (thanks to a stack overflow answer) and a few other minor issues) which have to be merged into each new update, so picking the "correct" one will obviously help.   On a side note I have a feeling that the correct answer might be that there is no correct answer...

 

Just looking for any feedback or thoughts.   And this post wouldn't be complete without thanking and acknowledging all the great work people have done on these projects!

 

-Mark

 

  • Like 2

Share this post


Link to post

I'm currently in the same situation of looking at the SynEdit-2 vs SynEdit.  I originally picked SynEdit-2 by Pyscripter due to his changes, but am now using the github/SynEdit version due to Gutter.ShowModification support.

 

Do you have your customizations on GitHub somewhere?  The word wrap issue (assuming: https://stackoverflow.com/questions/54494905/how-to-make-tsynedits-wordwrap-same-as-tmemos) is a problem in all 3 of the projects.  I haven't checked out the FPC version yet.

 

Have you tried a pull request of your modifications to either SynEdit or SynEdit-2?

 

Share this post


Link to post
Posted (edited)

I will start with a bit of history.

  • The Original Code is based on mwCustomEdit.pas by Martin Waldenburg, a great programmer.  The key feature of the editor was fast syntax highlighting.  This was more than 20 years ago.
  • After a split of the community the SynEdit project was formed maintaining some of the key features of mwEdit.
  • Over the years some of the best Delphi programmers contributed to the project.  The list includes for example Gerald Nunn, Eric Grange, Jordan Russell and many many others.
  • Flavio Etrusco added word wrap and Maël Hörz added unicode support (but in a rather idiosyncratic way).
  • However the project management was very weak and the code gradually became very hard to maintain and improve.  It aimed to support very old Delphi versions including Kylix and the code became full of IFDEFs and patches without an overall coherence.
  • An early fork of Synedit is part of Lazarus but the two development efforts have diverged a great deal.
  • When Embarcadero introduced the GetIt package manager they asked Roman Kassebaum to produce a version of SynEdit for GetIt.  Roman did a general code cleanup removing support for early Delphi versions and Kylix (Turbo fork(s)).
  • I have added support for code folding (the first major new feature for years) to both the Turbo fork and the main Synedit repository.
  • However the Turbo fork(s) were not actively supported or developed beyond recompiling for new Delphi versions and the main Synedit branch was too hard to work with, hence the creation of SynEdit-2 as a fork of Turbo SynEdit.

Main new features in SynEdit-2:

  • Replaced SynRegExpr with the built-in RegularExpressions
  • Move/Copy Line(s) Up/Down commands as in VS Code
  • Delete Line command should work with multi-line selection
  • Handle triple and quadruple clicks for selection
  • Triple click and drag should select lines 
  • Double click and drag should select whole words 
  • Support OLE Drag & Drop 

What are the key features missing in Synedit:

  • Better Unicode handling:
    • Better support for wide characters e.g. Chinese ideograms (爾雅爾雅爾雅爾雅)
    • Support for surrogate pairs (two widechars correspond to one glyph)
    • Combining characters (e.g. Åström ḱṷṓn)
  • Multi-cursor and multi-selection editing as in VS Code.

When these features get implemented I think SynEdit will become comparable to some of the best editors around. But both of them require major rewriting of the code.  Work on the second is well advanced and the unicode work is in the planning stage.

 

Of course it is your choice as to which version of SynEdit to use, but if anyone wants to contribute to the development you are very welcome.

 

 

Edited by pyscripter
  • Like 6
  • Thanks 2

Share this post


Link to post
Posted (edited)
26 minutes ago, Darian Miller said:

I'm currently in the same situation of looking at the SynEdit-2 vs SynEdit.  I originally picked SynEdit-2 by Pyscripter due to his changes, but am now using the github/SynEdit version due to Gutter.ShowModification support.

Unfortunately SynEdit's ShowModification is half-baked and does not work well when you undo.   This is why it has not been ported to SynEdit-2.  Proper support requires some work in the undo/redo system.

Edited by pyscripter

Share this post


Link to post
Posted (edited)

Judging from the VERxxx constants in the package source, SynEdit2 supports Delphi 2006 and up, correct? Could you please add that to the project description? @pyscripter

Edited by dummzeuch

Share this post


Link to post
2 minutes ago, dummzeuch said:

Judging from the VERxxx constants in the package source, SynEdit2 supports Delphi 2006 and up, correct? Could you please add that to the project description? @pyscripter

To be frank I am not sure.  Like the Turbo branch it is aimed at the most recent versions of Delphi.  The code uses generics and unicode, so that I suppose determines the minimum version.   

Share this post


Link to post
1 hour ago, pyscripter said:

What are the key features missing in Synedit:

  • Better Unicode handling:
    • Better support for wide characters e.g. Chinese ideograms (爾雅爾雅爾雅爾雅)
    • Support for surrogate pairs (two widechars correspond to one glyph)
    • Combining characters (e.g. Åström ḱṷṓn)

I'm using the official SynEdit github repository, it seems that it supports Chinese characters?

Share this post


Link to post
4 minutes ago, Edwin Yip said:

I'm using the official SynEdit github repository, it seems that it supports Chinese characters?

It does, but the spacing is not very good.

Share this post


Link to post

I use pyscripter version. 

FYI guys, pyscripter is one of the best developers that knows how to correctly maintain/extend 3rd party library. 

  • Like 1

Share this post


Link to post
11 hours ago, pyscripter said:

That would be good, but the author says it is not going to be easy.

How about not to port it to Delphi, but  instead, just wrap it as dynamic linking library for the Delphi program to use?

Share this post


Link to post
12 hours ago, pyscripter said:

To be frank I am not sure.  Like the Turbo branch it is aimed at the most recent versions of Delphi.  The code uses generics and unicode, so that I suppose determines the minimum version.   

In that case you could get rid of some lines in the .dpk file.

VER200 is the first Unicode version (Delphi 2009), It's also the first version that introduced Generics (no idea how usable/buggy they were in that version).

Share this post


Link to post
1 hour ago, Edwin Yip said:

How about not to port it to Delphi, but  instead, just wrap it as dynamic linking library for the Delphi program to use?

Even harder than porting to delphi. 

Share this post


Link to post
2 hours ago, Edwin Yip said:

And it's under active development.

The last commit was 5 years ago.

Share this post


Link to post
Posted (edited)

A more advanced wrapper for Scintilla was in http://myarmor.users.sourceforge.net/.   I had some involvement in the initial development.  But it died many years ago.

A more up to date  wrapper exists in the Inno Setup source code https://github.com/jrsoftware/issrc/tree/main/Components.  However it is based on Scintilla 2.22, when the current version is 4.4...

Edited by pyscripter

Share this post


Link to post
3 hours ago, toms said:

The last commit was 5 years ago.

By active development I mean the Scintilla library, not DScintilla, the delphi wrapper :)

Share this post


Link to post
2 hours ago, pyscripter said:

A more advanced wrapper for Scintilla was in http://myarmor.users.sourceforge.net/.   I had some involvement in the initial development.  But it died many years ago.

A more up to date  wrapper exists in the Inno Setup source code https://github.com/jrsoftware/issrc/tree/main/Components.  However it is based on Scintilla 2.22, when the current version is 4.4...

It seems that the myarmor DelphiSci wrapper is more feature-rich, but as you said, it's for v1.x and it's too old, not sure if it works with the latest version.

the InnoSetup version also suffers the same issue.

 

On the other hand, the github DScintilla I posted above works with 4.x (at least the version back in a year or so).

Actually the DScintilla wrapper communicates with Scintilla through the SendMessage windows API, so it's quite easy to adopt new features.

And don't forget , Scintilla is crossplatform (but not wrapper for Delphi on Linux or Mac).

Share this post


Link to post

Thanks to everyone who responded to this!  I'm new to git (and to contributing to open source projects) so I installed a bunch of stuff, cloned the SynEdit2 repository, made a branch (I think that's the correct thing), went to add the wordwrap fix I mentioned above... and found that pyscripter had already fixed it last December and I had totally missed it.  Nice!  I'm going to attempt a pull request on a very minor fix I have to try to get my feet wet on the process.

 

  • Like 2

Share this post


Link to post
On 6/25/2020 at 9:10 AM, MarkShark said:

cloned the SynEdit2 repository, made a branch (I think that's the correct thing)

This is not the correct process as I understand it, you should:

- Fork the repository on github web, so you that have your own repository that you can permission to make changes

- Clone your forked repository to your local pc

- Change the source code as needed (following the contribution rules, if any)

- Commit and push your changes to your forked repository

- Make a pull request to the original SynEdit2 repository, and wait for acceptance

  • Like 4

Share this post


Link to post

I have questions regarding SynEdit-2.

What is the earliest supported version of Delphi?

What are the dependencies on other packages?

I ask because I have tried two versions of Delphi, the latest being 10.2.3, and neither one will build the runtime.

image.png.883e0af3bcda4eeb9e7a90ec93fd1561.png

Share this post


Link to post

If you are switching from another version of Synedit to Synedit-2 you need to uninstall the current version, remove all compiled packages and install from scratch.  As mentioned above I am not sure which is the earliest version supported (same about the Turbo Synedit), however I am quite sure Delphi 10.2 should be good.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×