Forum > SynEdit

Can Synedit do something like attached picture?

(1/2) > >>

The attached picture shows a Propeller Tool code editor for Spin language.

What I want are these indentation lines I highlighted in the red ellipse. Spin is a indentation driven language and these lines help programming in it a lot.

These background colors are also convenient

Is it possible to recreate something similar in Synedit? If yes, where to search (tutorials, etc?)

Right-click on Code-Editor > "Options" > "Editor" > "Display" > "Markup and Matches": Check the box "Outline (global)" under "Matching Keywords"

Wow! This is of course is an instruction for Lazarus IDE

Setting this option in Lazarus IDE had a side effect:  highlight colors change (to much more fancy :)  )

So, it's possible. What I need is to write a Spin editor so I have to make a highlighter for this language with this option active by default.

The problem is: there are 2 tools for Propeller2 microcontroler.
One is Propeller Tool (the screen attached)
Second one is Flexprop.

The Propeller Tool is an integrated tool with all this fancy editing stuff, but it can only use its internal compiler.
The Flexprop is modular so its compiler can be called from CLI. It is much more flexible, allowing extended Spin syntax, C and Basic languages. But its editor is not the best. Its syntax highlighter don't work properly and lack of indentation highlighting causes bug tracking very hard.

So, as I am also a Lazarus user, my goal is to write a Spin editor with good syntax highlighting. Then it can call the standalone compiler to do the rest.

1) The colors are fully configurable. In the IDE this is under Tools > Options > Editor > color. Then all the way down are the "outline" colors.

2) Outside the IDE...
The outline is provided by the Markup.... (search ide/SourceSynEditor.pp or SynSource... for markup and outline)

To write your own highlighter:
You need to implement the full code-folding. This provides the info for the outline.
Then search for FoldConfig, there you can enable what will be outlined.


--- Quote from: pik33 on September 09, 2021, 10:59:33 am ---Setting this option in Lazarus IDE had a side effect:  highlight colors change (to much more fancy :)  )

--- End quote ---
I agree that the re-colored key words can look distracting, but most of the power of this tool comes from the colors. For example, when the final "end;" of a procedure is not red then I know that I forgot another "end" somewhere in between.


[0] Message Index

[#] Next page

Go to full version