[Geany-Users] Highlight C function names?

Enrico Tröger enrico.troeger at xxxxx
Thu Jan 16 21:33:54 UTC 2014


On 11/01/14 05:30, Lex Trotman wrote:
> On 11 January 2014 13:21, Nate Bargmann <n0nb at n0nb.us> wrote:
> 
>> As I use Geany for C work, one enhancement to the syntax highlighting
>> would be to have C function names highlighted.  This would be any
>> symbol, other than a C language keyword such as do, if, else, while,
>> etc. that often have an open parenthesis following them and are already
>> highlighted.
>>
>> For example, main() would have the word "main" highlighted but not the
>> paratheses.  Or, foo(bar(a, (b * x))) would have the words "foo" and "bar"
>> highlighted, and the parentheses, operators, and arguments would be in
>> the current colors.
>>
>> Perhaps this is a limitation of the Scintilla editor?
>>
> 
> You are correct that the first step would be to make Scintilla's C lexer
> identify function calls as separate entities that can be highlighted. (and
> an option to turn this off as well)

If I'm not totally wrong, you can already get quite close to that with
the "identifier" style in Geany.

To change this, either set style "identifier" in
.config/geany/filedefs/filetypes.c or more generally, set "identifier_1"
in .config/geany/filedefs/filetypes.common.

For more details about these config files, check the manual.

However, a quick test shown that the style identifier (as provided by
Scintilla) matches way more than function names only. It highlights also
local variables in functions and many more symbols.

Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.asc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.geany.org/pipermail/users/attachments/20140116/a8dd8880/attachment.pgp>


More information about the Users mailing list