[Geany] lua filetype: highlight func def name

Enrico Tröger enrico.troeger at xxxxx
Sat Nov 28 11:55:05 UTC 2009


On Thu, 12 Nov 2009 10:29:36 +0100, spir wrote:

>hello,
>
>cannot find how to highlight a func name in a func definition. (There
>is no attribute in standard filetype.lua -- function_basic and
>function_other are for builtin or stdlib func names). Tried to
>specifiy "functionname", "funcname", defname", but none worked.
>
>I know there is an issue because in lua a func can be defined either
>    function funcname(args) block end
>or
>    funcname = function(args) block end
>The second form may be problematic, but the first one is the same as
>in other common scripting languages. Would it be possible to add this
>attribute? I guess the pattern could be the same as for python, only
>replacing "def" by "function".
>
>Also, it would be nice to have a style attribute for multilne strings
>and multiline comments. (And I don't understand the difference between
>"string" and "literalstring" attributes.)

I don't know Lua very well at all but if I understand you correctly,
you might want to adjust the "identifier" style. This is the style
which is used for function names. However, this would also affect other
identifiers like variable names and such.
If that's not enough, you should file a feature request at the
Scintilla project to add another style to the Lua lexer for
highlighting function names.


>A little issue: when editing filetypes files themselves, they are
>highlighted like source files because of their extension (eg
>filetype.lua) --which is a bit disturbing ;-). Maybe a better scheme
>could be to name these config files langname.cfg (eg lua.cfg). For
>upgrading, the only thing to do is renaming filetype.x to x.cfg. Can
>be automatic.

I think this is a very minor issue. If you know you are editing
filetype definition files, you could set the filetype manually to
Config file in the file open dialog or afterwards using the
Document->Set filetype menu.
Changing the filenames and renaming them automatically on upgrade might
cause more problems and confusing than it would help.


Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/users/attachments/20091128/69863769/attachment.pgp>


More information about the Users mailing list