On 15 October 2012 02:35, Jean-Max Reymond <jmreymond@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
_______________________________________________
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users