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.Colorer — syntax highlighting and text parsing
Re: Colorer — syntax highlighting and text parsing
pepak
It is useful to have all prototypes in one file base/hrc/proto.hrc when you want to check for conflicting "rules".
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
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.
Code: Select all
<a>
<project/>
</a>
- John Doe
- Бюрократ
- Posts: 13861
- Joined: Wed 27 Apr, 2005 20:42
- Has thanked: 74 times
- Been thanked: 428 times
- Contact:
Re: Colorer — syntax highlighting and text parsing
F11\FarColorer\List types
As I can see this file detected as "Ant's build.xml"
As I can see this file detected as "Ant's build.xml"
Re: Colorer — syntax highlighting and text parsing
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)?
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)?
- John Doe
- Бюрократ
- Posts: 13861
- Joined: Wed 27 Apr, 2005 20:42
- Has thanked: 74 times
- Been thanked: 428 times
- Contact:
Re: Colorer — syntax highlighting and text parsing
Try to define empty scheme (or just it's prototype) with same name.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?
Make your own proto_pepak.hrc and include it in catalog.xml before proto.hrc
Use folder "auto", or use own catalog.xml (enter path in plugin's settings)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)?
Re: Colorer — syntax highlighting and text parsing
Maybe that was why my override didn't work - I included it after the default one.John Doe wrote:Try to define empty scheme (or just it's prototype) with same name.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?
Make your own proto_pepak.hrc and include it in catalog.xml before proto.hrc
Sounds good to me. Thanks!Use folder "auto", or use own catalog.xml (enter path in plugin's settings)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)?
- John Doe
- Бюрократ
- Posts: 13861
- Joined: Wed 27 Apr, 2005 20:42
- Has thanked: 74 times
- Been thanked: 428 times
- Contact:
Re: Colorer — syntax highlighting and text parsing
Please note that you can add schemes via 'auto' folder, but it's impossible to override existing in this way.pepak wrote:Sounds good to me. Thanks!Use folder "auto", or use own catalog.xml (enter path in plugin's settings)
Re: Colorer — syntax highlighting and text parsing
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>
- John Doe
- Бюрократ
- Posts: 13861
- Joined: Wed 27 Apr, 2005 20:42
- Has thanked: 74 times
- Been thanked: 428 times
- Contact:
Re: Colorer — syntax highlighting and text parsing
Interesting...pepak wrote:In fact, the override really needs to be used after the definition.
What if you do it in 'auto'?
Alternatively you can try to change 'weight' attribute of <filename> or <firstline>pepak wrote:And it only needs to override <location>:
Colorer — syntax highlighting and text parsing
I don't know. An external catalog.xml is more suitable for my needs, so I went that way.John Doe wrote:Interesting...pepak wrote:In fact, the override really needs to be used after the definition.
What if you do it in 'auto'?
That's what I tried the first time, but without success.John Doe wrote:Alternatively you can try to change 'weight' attribute of <filename> or <firstline>pepak wrote:And it only needs to override <location>:
- John Doe
- Бюрократ
- Posts: 13861
- Joined: Wed 27 Apr, 2005 20:42
- Has thanked: 74 times
- Been thanked: 428 times
- Contact:
Re: Colorer — syntax highlighting and text parsing
Just tried by myself.pepak wrote:In fact, the override really needs to be used after the definition.
You are right, probably this behavior was changed at some point.
So now you are able use 'auto' folder for redefinition too.
No, it is not necessary, better left it as is (to be able to choose the scheme from the list when needed).pepak wrote:And it only needs to override <location>
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
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
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
to <filename>/\.(py|pyw|pys|vpy)$/i</filename>
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>
ES6 Template Literal syntax highlighting
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 `...`.
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 `...`.
Last edited by Guest on Wed 14 Jun, 2017 13:32, edited 1 time in total.
Reason: Copied the ex-topic subject into the message
Reason: Copied the ex-topic subject into the message