[xed] How do I update JavaScript colors?

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
james-r
Level 1
Level 1
Posts: 17
Joined: Wed Aug 21, 2019 7:37 pm

[xed] How do I update JavaScript colors?

Post by james-r »

Methods such as

Code: Select all

substring()
get coloured in blue, while others like

Code: Select all

forEach
don't.
Is it possible to fix this manually?
I am using the Kate style scheme.

james-r
Level 1
Level 1
Posts: 17
Joined: Wed Aug 21, 2019 7:37 pm

Re: [xed] How do I update JavaScript colors?

Post by james-r »

Bump.

james-r
Level 1
Level 1
Posts: 17
Joined: Wed Aug 21, 2019 7:37 pm

Re: [xed] How do I update JavaScript colors?

Post by james-r »

Bump.

User avatar
smurphos
Level 15
Level 15
Posts: 5882
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: [xed] How do I update JavaScript colors?

Post by smurphos »

You can try modifying an existing color scheme, making your own or downloading some additional schemes..

The default scheme definitions can be found in /usr/share/gtksourceview-3.0/styles. They are plain text xml files so reasonably straightforward to edit as an end user.

If you copy one (or more) to somewhere in your home directory to act as a starting point for modification once done you can add your personalised scheme via xed's Install scheme button.

Image

For javascript highlighting you many want to refer to the contents of /usr/share/gtksourceview-3.0/language-specs/javascript.lang to guide you in making your modified scheme.

Also see https://wiki.gnome.org/Projects/GtkSour ... yleSchemes for some alternative schemes you can download and then manually add to xed.

Also these should also work - https://www.gnome-look.org/browse/cat/279/
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.

User avatar
smurphos
Level 15
Level 15
Posts: 5882
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: [xed] How do I update JavaScript colors?

Post by smurphos »

Hi on a further look focusing on your specific question..... :wink:

/usr/share/gtksourceview-3.0/language-specs/javascript.lang defines substring as a function, and maps functions to def:builtin, which /usr/share/gtksourceview-3.0/styles/kate.xml in turn sets as dark-blue.

forEach is not defined at all in /usr/share/gtksourceview-3.0/language-specs/javascript.lang so maybe tweaking that file to add the definition is the actual fix to your issue.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.

james-r
Level 1
Level 1
Posts: 17
Joined: Wed Aug 21, 2019 7:37 pm

Re: [xed] How do I update JavaScript colors?

Post by james-r »

Thank you a lot.
It worked.

Post Reply

Return to “Software & Applications”