Colorer — syntax highlighting and text parsing

Here you can discuss about your favorite plug-in.
kamil
Posts: 20
Joined: Fri 13 Apr, 2012 19:19

Re: Colorer — syntax highlighting and text parsing

Post by kamil » Mon 24 Dec, 2012 13:37

Latest post of the previous page:

Thanks for you answer HaRT.

In fact I did use Visualizer for that and it was great, but it does not seem to even load anymore, with the latest Far.
http://code.google.com/p/evil-programme ... ualizer.7z

So maybe any ideas how to fix it?

User avatar
HaRT
Moderator
Posts: 8076
Joined: Tue 30 Aug, 2005 17:21
Location: Санкт-Петербург
Has thanked: 67 times
Been thanked: 100 times

Re: Colorer — syntax highlighting and text parsing

Post by HaRT » Mon 24 Dec, 2012 13:45

kamil
You might wish to feed the Visualizer discussion topic to an online translator of your choice for more insight.
Фар есть инструмент, а не нянька. © 2009 DrKnS

kamil
Posts: 20
Joined: Fri 13 Apr, 2012 19:19

Re: Colorer — syntax highlighting and text parsing

Post by kamil » Mon 24 Dec, 2012 13:54

HaRT wrote:kamil
You might wish to feed the Visualizer discussion topic to an online translator of your choice for more insight.
Thank you sir - that's exactly what I needed!

astral2k5
Posts: 9
Joined: Sun 04 Nov, 2012 22:13

Re: Colorer — syntax highlighting and text parsing

Post by astral2k5 » Tue 26 Mar, 2013 00:15

I've just moved to Far 3 from 1.75.

And i've encountered a problem with FarColorer:
just open the changelog file from Far folder and press CTRL+END, it will move you to the end of the file, you'll see that the highlighting is not updated is like colorer is disabled. If you press F11 ->FarColorer ->Update Highlighting it shows correctly.

Can this be fixed or is there a setting to force highlight update automatically for larger files?

User avatar
HaRT
Moderator
Posts: 8076
Joined: Tue 30 Aug, 2005 17:21
Location: Санкт-Петербург
Has thanked: 67 times
Been thanked: 100 times

Re: Colorer — syntax highlighting and text parsing

Post by HaRT » Tue 26 Mar, 2013 10:37

astral2k5
Just wait a few moments, the highlighting will update after a while. Colorer needs to parse the entire file to know how to highlight its tail.
Фар есть инструмент, а не нянька. © 2009 DrKnS

astral2k5
Posts: 9
Joined: Sun 04 Nov, 2012 22:13

Re: Colorer — syntax highlighting and text parsing

Post by astral2k5 » Tue 26 Mar, 2013 20:52

HaRT,
for the changelog to be parsed normally it takes 10 seconds or more if I'm at the end of the file. But if I press F11 ->FarColorer ->Update Highlighting it shows highlighting instantly. So it must to be a bug or something. I have a fast PC, even on Far 1.75 Colorer was working instantly.

User avatar
DrKnS
Posts: 4621
Joined: Thu 04 Aug, 2005 06:44
Location: Kyiv
Has thanked: 4 times
Been thanked: 122 times
Contact:

Re: Colorer — syntax highlighting and text parsing

Post by DrKnS » Tue 26 Mar, 2013 21:06

It's not a bug. By default Colorer slowly does his job in background to avoid interfering with your actions. When you press F11 ->FarColorer ->Update Highlighting you will not be able to do anything until it's completed, which can be very annoying. But it may be a good idea to ask author for an option to control this.

2useven10
Posts: 3011
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 2 times
Been thanked: 82 times

Re: Colorer — syntax highlighting and text parsing

Post by 2useven10 » Tue 26 Mar, 2013 21:13

By default Colorer slowly does his job in background
Why so slooooooooooooooooowly ?
17 seconds on my home PC (I thought it is quiet fast) / and about 0.5 second after update colorer highlighting...

astral2k5
Posts: 9
Joined: Sun 04 Nov, 2012 22:13

Re: Colorer — syntax highlighting and text parsing

Post by astral2k5 » Tue 26 Mar, 2013 21:21

F11 ->FarColorer ->Update Highlighting takes 1-2 seconds on my PC to show all changelog correctly.

Strange is that on Far 1.75 colorer was working faster....it should be other way around, I'm using the x64 version, it might not be optimized or something for it ?

Игорь Юдинцев
Posts: 725
Joined: Sun 03 Apr, 2005 22:00
Location: Казань
Been thanked: 1 time

Re: Colorer — syntax highlighting and text parsing

Post by Игорь Юдинцев » Wed 27 Mar, 2013 05:43

astral2k5
You might be using Colorer 4, it does not build highlighting for the whole file, just visible text.

pandronic
Posts: 30
Joined: Tue 23 Mar, 2010 12:04

FarColorer Bug

Post by pandronic » Mon 09 Dec, 2013 16:09

I'm using FarColorer 1.0.3.12 with Far 3.0 build 3525 x86

FarColorer doesn't update the syntax highlighting when typing. Here's an album with the problem: http://imgur.com/a/heLzP
  • Image 1 shows a script that was just loaded into the editor. Syntax highlighting is correct.
  • In image 2 I just wrote the line with <p> and <strong>. No syntax highlighting is present.
  • In image 3 it's the same script after quiting the editor and loading it again. Syntax highlighting is correct.
How can i fix the situation?

Thanks

pandronic
Posts: 30
Joined: Tue 23 Mar, 2010 12:04

Re: Colorer — syntax highlighting and text parsing

Post by pandronic » Mon 09 Dec, 2013 16:44

Further information. It seems that Colorer is only updating the text and not the colors.
The text moves upwards, the colors stay in place.

pandronic
Posts: 30
Joined: Tue 23 Mar, 2010 12:04

Re: Colorer — syntax highlighting and text parsing

Post by pandronic » Wed 11 Dec, 2013 15:58

I solved the problem myself. Apparently version 1.0.3.12 is not the latest. Don't be fooled by the fact that on FarPlug and the homepage of FarColorer this is the latest version you can download. You can get 1.2.1.5 by unzipping the latest Far Nightly. This is ridiculous. It seems that the Far developers suffer from the "don't give a fuck" syndrome.

pepak
Posts: 329
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 3 times
Been thanked: 9 times

Re: Colorer — syntax highlighting and text parsing

Post by pepak » Sun 15 Dec, 2013 15:34

Can someone please point me to some tutorial on creating my own coloring schemes? I wanted to highlight a specific file format I use in my application, which is basically a number of lines with a pretty fixed format like this:

Code: Select all

command filename filesize filedate filehash [extra]
So I extracted filesbbc.hrc from Colorer's common.jar and updated the regexp definitions. That seemed straightforward enough, but now I am uncertain how to make Far Colorer to actually use this definition on my files. I tried adding a link to this file to catalog.xml, but no success. I updated my file to include a <prototype> section with a <filename> definition, and now I can see my scheme in Colorer's "Scheme settings", but I still can't get colored text for my file.

The HRC file is:

Code: Select all

<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE hrc PUBLIC "-//Cail Lomecb//DTD Colorer HRC take5//EN"
  "http://colorer.sf.net/2003/hrc.dtd">
<hrc version="take5" xmlns="http://colorer.sf.net/2003/hrc"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://colorer.sf.net/2003/hrc http://colorer.sf.net/2003/hrc.xsd">
   <type name="vfy">

      <import type="def"/>
      <region name="VfyOperator" parent="Keyword" description="VFY operator" />
      <region name="VfyFileName" parent="Path" description="Path" />
      <region name="VfyFileSize" parent="Number" description="Size of file" />
      <region name="VfyFileDate" parent="Date" description="Date/time of file" />
      <region name="VfyFileHash" parent="Comment" description="Hash of file" />



      <scheme name="vfy">
         <regexp match="/^(MATCHED|ADDED|CHANGED|DELETED|COPIED|RENAMED)\t/i" region0="VfyOperator"/>
         <regexp match="/^(\".*?\")/i" region0="VfyFileName"/>
         <regexp match="/(?<=\s)(\d+)/" region0="VfyFileSize"/>
         <regexp match="/(?<=\s)(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(.\d{3})?)(?=\s)/i" region0="VfyFileDate"/>
         <regexp match="/(?<=\s)([a-zA-Z0-9+/]{22})==/" region0="VfyFileHash"/>
      </scheme>

   </type>

  <prototype name="vfy" group="other" description="vfy (pepak)">
    <filename>/(.*\.(hashlist|changes))$/i</filename>
  </prototype>

</hrc>
And the relevant lines in catalog.xml:

Code: Select all

<hrc-sets log-location="">

    <location link="&hrc;/proto.hrc"/>
    <location link="&hrc;/pepak/vfy.hrc"/>
    <location link="&hrc;/auto"/>

  </hrc-sets>

pepak
Posts: 329
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 3 times
Been thanked: 9 times

Re: Colorer — syntax highlighting and text parsing

Post by pepak » Sun 15 Dec, 2013 17:33

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.

pp
Posts: 35
Joined: Wed 24 Jan, 2007 11:39
Location: Česká republika
Contact:

Re: Colorer — syntax highlighting and text parsing

Post by pp » Mon 16 Dec, 2013 15:12

pepak
It is useful to have all prototypes in one file base/hrc/proto.hrc when you want to check for conflicting "rules".

pepak
Posts: 329
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 3 times
Been thanked: 9 times

Re: Colorer — syntax highlighting and text parsing

Post by pepak » Fri 14 Mar, 2014 15:33

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:

Code: Select all

<a>
	<project/>
</a>
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.

Post Reply

Return to “General Plug-In Discussions”