[xed] How do I update JavaScript colors?

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
james-r
Level 2
Level 2
Posts: 54
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.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
james-r
Level 2
Level 2
Posts: 54
Joined: Wed Aug 21, 2019 7:37 pm

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

Post by james-r »

Bump.
james-r
Level 2
Level 2
Posts: 54
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 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
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 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
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 2
Level 2
Posts: 54
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.
Locked

Return to “Software & Applications”