Page 3 of 5
Re: Colorer — syntax highlighting and text parsing
Posted: Sun 15 Dec, 2013 17:33
by pepak
Latest post of the previous page:
Never mind, seems that I got it now: Apparently I need to provide the prototype in one file and the rest of the definition in another file. Now I don't quite understand why, but at least it works.
Re: Colorer — syntax highlighting and text parsing
Posted: Mon 16 Dec, 2013 15:12
by pp
pepak
It is useful to have all prototypes in one file base/hrc/proto.hrc when you want to check for conflicting "rules".
Re: Colorer — syntax highlighting and text parsing
Posted: Fri 14 Mar, 2014 15:33
by pepak
Can I somehow detect which .hrc file is responsible for a particular instance of syntax coloring? I have a XML file which is regularly shown as invalid by FarColorer from FAR3 build 1800, but I just can't find any possible cause in common.jar:xml\xml.hrc, or indeed any file in the xml directory. For some reason I can't figure out, FarColorer dislikes XMl tag <project>. Example file which will show the error:
Everything from <project/> to the end of the file is marked as error. But if I change the tag to projecta and reload the file, FarColorer is happy again.
Re: Colorer — syntax highlighting and text parsing
Posted: Fri 14 Mar, 2014 16:13
by John Doe
F11\FarColorer\List types
As I can see this file detected as "Ant's build.xml"
Re: Colorer — syntax highlighting and text parsing
Posted: Tue 18 Mar, 2014 07:48
by pepak
Thanks. Will try to remove Ant's build and live happily ever after :-)
Re: Colorer — syntax highlighting and text parsing
Posted: Thu 20 Mar, 2014 09:44
by pepak
More help needed: I can disable ant by editing the proto.hrc file. Is there a way to override/disable the syntax scheme from an external file? I added my own .hrc file to catalog.xml (via <location>) where I put pepak-specific changes. I would much prefer to disable ant in my file than in the distributed files. Can I do it?
On a related note, can I add pepak.hrc and pepak.hrd to Colorer without editing catalog.xml (for .hrc) or catalog-console.xml (for .hrd)?
Re: Colorer — syntax highlighting and text parsing
Posted: Thu 20 Mar, 2014 10:09
by John Doe
pepak wrote:More help needed: I can disable ant by editing the proto.hrc file. Is there a way to override/disable the syntax scheme from an external file?
Try to define empty scheme (or just it's prototype) with same name.
Make your own proto_pepak.hrc and include it in catalog.xml
before proto.hrc
pepak wrote:On a related note, can I add pepak.hrc and pepak.hrd to Colorer without editing catalog.xml (for .hrc) or catalog-console.xml (for .hrd)?
Use folder "auto", or use own catalog.xml (enter path in plugin's settings)
Re: Colorer — syntax highlighting and text parsing
Posted: Thu 20 Mar, 2014 10:14
by pepak
John Doe wrote:pepak wrote:More help needed: I can disable ant by editing the proto.hrc file. Is there a way to override/disable the syntax scheme from an external file?
Try to define empty scheme (or just it's prototype) with same name.
Make your own proto_pepak.hrc and include it in catalog.xml
before proto.hrc
Maybe that was why my override didn't work - I included it
after the default one.
pepak wrote:On a related note, can I add pepak.hrc and pepak.hrd to Colorer without editing catalog.xml (for .hrc) or catalog-console.xml (for .hrd)?
Use folder "auto", or use own catalog.xml (enter path in plugin's settings)
Sounds good to me. Thanks!
Re: Colorer — syntax highlighting and text parsing
Posted: Thu 20 Mar, 2014 10:20
by John Doe
pepak wrote:Use folder "auto", or use own catalog.xml (enter path in plugin's settings)
Sounds good to me. Thanks!
Please note that you can add schemes via 'auto' folder, but it's impossible to override existing in this way.
Re: Colorer — syntax highlighting and text parsing
Posted: Thu 20 Mar, 2014 10:31
by pepak
In fact, the override really needs to be used
after the definition. And it only needs to override <location>:
Code: Select all
<prototype name="ant" group="scripts" description="Ant's build.xml (disabled)" targetNamespace="http://jakarta.apache.org/ant/">
<location link="jar:common.jar!xml/xml.hrc"/>
</prototype>
Re: Colorer — syntax highlighting and text parsing
Posted: Thu 20 Mar, 2014 10:54
by John Doe
pepak wrote:In fact, the override really needs to be used after the definition.
Interesting...
What if you do it in 'auto'?
pepak wrote:And it only needs to override <location>:
Alternatively you can try to change 'weight' attribute of <filename> or <firstline>
Colorer — syntax highlighting and text parsing
Posted: Thu 20 Mar, 2014 10:59
by pepak
John Doe wrote:pepak wrote:In fact, the override really needs to be used after the definition.
Interesting...
What if you do it in 'auto'?
I don't know. An external catalog.xml is more suitable for my needs, so I went that way.
John Doe wrote:pepak wrote:And it only needs to override <location>:
Alternatively you can try to change 'weight' attribute of <filename> or <firstline>
That's what I tried the first time, but without success.
Re: Colorer — syntax highlighting and text parsing
Posted: Fri 21 Mar, 2014 14:00
by John Doe
pepak wrote:In fact, the override really needs to be used after the definition.
Just tried by myself.
You are right, probably this behavior was changed at some point.
So now you are able use 'auto' folder for redefinition too.
pepak wrote:And it only needs to override <location>
No, it is not necessary, better left it as is (to be able to choose the scheme from the list when needed).
You can keep most of old definition, but change 'condition' (I am not sure if this term is correct).
In your example 'condition' is
<firstline weight='5'>
, so you may change '5' to '3', or just comment whole line.
Colorer — syntax highlighting and text parsing
Posted: Tue 29 Dec, 2015 16:39
by LigH
I would like to add the extension ".vpy" to add VapourSynth scripts (basically Python, just a specific object hierarchy for video processing) to the group of files being highlighted with Python syntax. Is there any recommended way to achieve that in the Far plugin dialogs, or would I have to patch the Colorer files manually?
Colorer — syntax highlighting and text parsing
Posted: Sat 23 Jan, 2016 09:27
by LigH
Got a reply in the
Google group for the take5 Colorer:
One has to change
Plugins\FarColorer\base\hrc\proto.hrc and edit the "filename" RegEx in
Code: Select all
<prototype name="python" group="main" description="Python">
<location link="jar:common.jar!base/python.hrc"/>
<filename>/\.(py|pyw|pys)$/i</filename>
<firstline weight='2'>/^\#!\S*.+python/</firstline>
</prototype>
to <filename>/\.(py|pyw|pys
|vpy)$/i</filename>
ES6 Template Literal syntax highlighting
Posted: Wed 14 Jun, 2017 06:11
by d3x0r
ES6 Template Literal syntax highlighting
In the editor, Javascript template literals quoted with ` ` do not group the text as text; and instead open/close parens/braces in the string affect highlighting next entries.
https://developer.mozilla.org/en-US/doc ... e_literals
Would be nice if support was added for strings quoted with `...`.