[Geany-Users] adding json support

Matthew Brush mbrush at xxxxx
Sun Feb 24 00:02:49 UTC 2013


On 13-02-23 03:30 PM, Bob Furber wrote:
> On 13-02-22 05:30 PM, Matthew Brush wrote:
>> Someone changed my wiki entry so the filetype is YAML instead of
>> JavaScript[1]. Set it back to JavaScript and set the `[styling]`
>> section back to `[styling=C]`, removing the partial set of styles
>> added in that change and highlighting should work perfect (after all,
>> isn't JSON valid JavaScript syntax?). You can check "Old Revisions" on
>> the wiki to see the original entry and the additions later on.
>
> Is the [1] in "instead of JavaScript[1]" significant?
>

Scroll down to the bottom of my email.

> I changed filetypes.JSON.conf to:
>
>      [styling=C]
>      default=default
>      number=number
>      string=string
>      word=word
>      identifier=identifier,bold
>

Delete everything after [styling=C] there (from "default" to 
"identifier" keys).

>      [keywords]
>      primary=true false null
>
>      [settings]
>      extension=json
>      lexer_filetype=Javascript
>      comment_single=#
>      comment_use_indent=true
>
>      [indentation]
>      width=2
>      # 0 is spaces, 1 is tabs, 2 is tab & spaces
>      type=0
>
> Syntax highlighting is still not so colourful: Names are bold black and
> values are normal black unless they are numbers, in which case they are
> green.
>

Because you left YAML styles above maybe (under [styling=C]).

> Highlighting of matching '[' and '{' braces works fine after rebooting
> my PC.
>

Should never need to reboot PC for anything with Geany, but often making 
changes to configuration files requires restarting all Geany instances.

> Setting the filetype to Javascript (Document -> Set Filetype ->
> Scripting Languages -> Javascript) results in a more colourful display,
> but without any differentiation between names and values.
>

It highlights it the same as JavaScript. I don't know what names and 
values are in this context, but it highlights quoted "strings" the same 
no matter where they appear, as far as I know.

> Is there any way of customizing this without launching a new career?
>

Depends how much of the manual you read :)

>>
>> Please update the wiki if you find it's incorrect.
>
> How do I do that?
>

Create a login, login, and click "Edit" or whatever it's labeled on the 
page you want to edit. Pretty much same as any wiki.

Cheers,
Matthew Brush


More information about the Users mailing list