Colorer — syntax highlighting and text parsing

Here you can discuss about your favorite plug-in.
User avatar
HaRT
Moderator
Posts: 10806
Joined: Tue 30 Aug, 2005 17:21
Has thanked: 220 times
Been thanked: 357 times

Re: Colorer — syntax highlighting and text parsing

Post by HaRT »

Latest post of the previous page:

kamil
In Colorer, you'd need to edit the schemes for those file kinds you want the TABs highlighted in.
If you need to see TABs regardless of the file syntax, I'd recommend you the Visualizer plugin.
Фар есть инструмент, а не нянька. © 2009 DrKnS
kamil
Posts: 44
Joined: Fri 13 Apr, 2012 19:19
Has thanked: 8 times

Re: Colorer — syntax highlighting and text parsing

Post by kamil »

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: 10806
Joined: Tue 30 Aug, 2005 17:21
Has thanked: 220 times
Been thanked: 357 times

Re: Colorer — syntax highlighting and text parsing

Post by HaRT »

kamil
You might wish to feed the Visualizer discussion topic to an online translator of your choice for more insight.
Фар есть инструмент, а не нянька. © 2009 DrKnS
kamil
Posts: 44
Joined: Fri 13 Apr, 2012 19:19
Has thanked: 8 times

Re: Colorer — syntax highlighting and text parsing

Post by kamil »

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 »

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: 10806
Joined: Tue 30 Aug, 2005 17:21
Has thanked: 220 times
Been thanked: 357 times

Re: Colorer — syntax highlighting and text parsing

Post by HaRT »

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 »

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: 6114
Joined: Thu 04 Aug, 2005 06:44
Location: Kyiv
Has thanked: 12 times
Been thanked: 426 times

Re: Colorer — syntax highlighting and text parsing

Post by DrKnS »

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: 5192
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 18 times
Been thanked: 309 times

Re: Colorer — syntax highlighting and text parsing

Post by 2useven10 »

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 »

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: 726
Joined: Sun 03 Apr, 2005 22:00
Location: Казань
Been thanked: 2 times

Re: Colorer — syntax highlighting and text parsing

Post by Игорь Юдинцев »

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 »

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:
  • 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 »

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 »

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: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

Re: Colorer — syntax highlighting and text parsing

Post by pepak »

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: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

Re: Colorer — syntax highlighting and text parsing

Post by pepak »

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.
Post Reply

Return to “General Plug-In Discussions”