[Geany-Users] awk filetypes

Lex Trotman elextr at gmail.com
Sun Oct 14 23:46:48 UTC 2012


On 15 October 2012 02:35, Jean-Max Reymond <jmreymond at free.fr> wrote:

> Hi,
> I have written a filetype for awk files but I have some troubles with
> lexer_filetype
>
> In order to work correctly, I have to add a line lexer_filetype=C (whitout
> this line, nothing is colored). So, my keywords are highligted  but the
> commentary does not work, only the C syntax is highligted. What's wrong ?
> Thanks for your tips,


Hi,

The lexer is the piece of code that parses your file to decide what colour
each character should be, thats why you need to specify one.  The
lexer_filetype=X says use the lexer that is used for filetype X. So that
line tells your filetype to use the C lexer, so thats why only C comments
are highlighted.  Note the C lexer is hard coded to C syntax, if you set
the various comment settings in the filetype file they affect things like
menu->edit->format->comment/uncomment/toggle comment not the lexer.  I
don't remember the awk details but I would think C is probably the nearest
other language.

The lexers are part of the Scintilla project whose editing widget we use (
www.scintilla.org).  Unfortunately they don't have an awk specific one so
someone would have to write one to get exact awk syntax colouration.

Cheers
Lex


>
>
> --
> Jean-Max Reymond
> Éruption de l'Etna: http://jmreymond.free.fr/**Etna2002<http://jmreymond.free.fr/Etna2002>
> ______________________________**_________________
> Users mailing list
> Users at lists.geany.org
> https://lists.geany.org/cgi-**bin/mailman/listinfo/users<https://lists.geany.org/cgi-bin/mailman/listinfo/users>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/users/attachments/20121015/e3f502cb/attachment.html>


More information about the Users mailing list