Recent

Author Topic: [SOLVED] SynEdit and INI file syntax  (Read 10807 times)

kribjo

  • New Member
  • *
  • Posts: 11
[SOLVED] SynEdit and INI file syntax
« on: December 15, 2010, 04:31:52 pm »
Hi,

This is my first topic in the Lazarus forum. I'm sorry if I have put the topic in the wrong group.

I'm using the latest version of CodeTyphoon dated 7th of December 2010. I want to use the SynEdit component with INI file syntax, but there is not a component for it. How do I go about adding INI file syntax on the component pallette?

Regards,

Bjørn
« Last Edit: February 17, 2011, 09:58:45 am by kribjo »
Regards,

Bjørn

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12199
  • Debugger - SynEdit - and more
    • wiki
Re: SynEdit and INI file syntax
« Reply #1 on: December 15, 2010, 05:48:41 pm »
SynEdit (the Lazarus Version) currently has a fixed set of highlighters.

- There currently is no highlighter for ini files.
- There also is no highlighter with extended configurable grammar.

- There are 2 configurable highlighters (SynPosition and SynAny) => see examples folder

If you whish to write a SynEdit highlighter for ini files, then you can look at the highlighters for: LFM, DIFF
There a both reasonable simple.

---
For a list of highlighter related discussions (may not help for this topic) please see:
http://wiki.lazarus.freepascal.org/SynEdit_Highlighter#References

kribjo

  • New Member
  • *
  • Posts: 11
Re: SynEdit and INI file syntax
« Reply #2 on: December 16, 2010, 09:43:28 am »
OK, thanks for you quick reply. Will look into this later, but will focus on my main project as for now.

Regards,

Bjørn
Regards,

Bjørn

vrode

  • Newbie
  • Posts: 5
Re: SynEdit and INI file syntax
« Reply #3 on: December 16, 2010, 06:04:16 pm »
In attachment ini and bat highlighters.
How about add them to SynEdit package

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12199
  • Debugger - SynEdit - and more
    • wiki
Re: SynEdit and INI file syntax
« Reply #4 on: December 16, 2010, 07:44:58 pm »
Thank you.

I'll have a look at them later, (could be a couple of days, or weeks, depends on other work items)

I'll get you feedback, and yes eventually will add them to SynEdit in Lazarus.

That requires that you license them compatible to the rest of SynEdit:
- Minimum GPL and MPL at the users choice
- You can give the user additional choices, but as the apply to you code only (and you code inherits from SynEdit), such added rights would only be useful, if users wish to use partial copies of your code outside SynEdit (e.g if you included code that can run independent of SynEdit, such as helper classes)


I added an issue in Mantis, so it will not be forgotten:

http://bugs.freepascal.org/view.php?id=18230

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12199
  • Debugger - SynEdit - and more
    • wiki
Re: SynEdit and INI file syntax
« Reply #5 on: December 16, 2010, 08:38:53 pm »
Btw IFDEF SYN_LAZARUS
that's hsitorical, no longer used. It always is.

so no need to add/keep this ifdef anymore

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12199
  • Debugger - SynEdit - and more
    • wiki
Re: SynEdit and INI file syntax
« Reply #6 on: December 16, 2010, 09:50:38 pm »
Ok, generally good wwork, a few things:

- unless you want to enter history (and more important the contributors list) as "vrode", you should tell me what to enter there (your Name).

- I applied a patch, so you can see them in the IDE. Please apply your desired default colors (using editor-options) and export them as XML => I can then add them to the IDE defaults.
(Seems the IDE ignores the hardcoded defaults in your class, and I don't have the time to fix that...)

- If you have icons for the component palette, saves me the work of creating them :)

- From the headers you copied, it is probably better to drop the old author lines, since they now have the wrong name in it. Or put your name in it.

- In bat hl: if you have echo the rest of the line is text => should neither highlight keywords nor recognize rem ( I am not sure rem can be after a command at all: "copy a b rem text" gives an error)
Those should be easy to fix.

- In bat hl: "copy a.bat copy" the 2nd copy is a filename, not a command. Not sure how that can be identified best.... (if not, it's not a blocker)

- Do ini or bat files define escaped quotes \" for a quote inside text ?

vrode

  • Newbie
  • Posts: 5
Re: SynEdit and INI file syntax
« Reply #7 on: December 16, 2010, 10:16:08 pm »
I have used files from SynEdit1.1 for Delphi and just a little correct for FreePascal.
So do changes what you consider necessary.

vrode

  • Newbie
  • Posts: 5
Re: SynEdit and INI file syntax
« Reply #8 on: December 19, 2010, 10:24:16 am »
Thanks Martin for quick adding highlighters.
In attachment patch to fix echo and rem in bat_hl and
add default colors in ini_hl.

kribjo

  • New Member
  • *
  • Posts: 11
Re: SynEdit and INI file syntax
« Reply #9 on: February 17, 2011, 09:58:21 am »
Thanks, vrode for supplying highlighter for INI and Martin for adding. :-)

Regards,

Bjørn
Regards,

Bjørn

 

TinyPortal © 2005-2018