keywords.txt: all keywords are orange [SOLVED]

Hi,

I am writing a library. In my keywords.txt, I use KEYWORD1, KEYWORD2, KEYWORD3, ... but they are all comming out as orange, whatever the number.

Is there a tutorial on how to do it properly?

In Learning/Tutorials/Hacking/Creating a Library, it is stated that KEYWORD2 should come out brown (just like Arduino's functions).

Thanks for your help.

Jacques

I haven't found much documentation about this. Here's what I get in Arduino IDE 1.8.3:
Clipboard01.png
As you can see, KEYWORD1 is the same color as KEYWORD2 and KEYWORD3 but unlike the others it is bold. I don't know why they have all these different keyword types defined but don't bother to make them different colors. One of those Arduino mysteries...

I opened up theme.txt and there is what I found

# TEXT - KEYWORDS

# FUNCTIONS
editor.keyword1.style = #d35400,bold
editor.data_type.style = #d35400,bold

# METHODS
editor.keyword2.style = #D35400,plain
editor.function.style = #d35400,plain

# STRUCTURES
editor.keyword3.style = #5E6D03,plain
editor.reserved_word.style = #5E6D03,plain


# TEXT - LITERALS
editor.literal1.style = #00979C,plain
editor.literal2.style = #00979C,plain
editor.variable.style = #00979C,plain
editor.reserved_word_2.style = #00979C,plain
editor.literal_boolean.style = #00979C,plain
editor.literal_char.style = #00979C,plain

I tried KEYWORD3 and LITERAL1 in keywords.txt but there is no change.

If you change the selection in your Tools > Board menu it will rescan the libraries and you should definitely see the difference between KEYWORD1 and LITERAL1.

pert:
If you change the selection in your Tools > Board menu it will rescan the libraries and you should definitely see the difference between KEYWORD1 and LITERAL1.

Tried it... No change.

Yes, I closed the IDE and reloaded the sketch.

You can set the IDE to external editor.
Notepad++ allows you to modify the look.

Riva has a link here to set up ++ to Arduino
https://forum.arduino.cc/index.php?topic=141050.0

.

jbellavance:
Tried it... No change.

Yes, I closed the IDE and reloaded the sketch.

Strange. Which version of the Arduino IDE? That was 1.8.3 but I know I had the same results with 1.8.0 because I have a screenshot of it.

This is the keywords.txt file I used to generate the screenshot I posted:

# the purpose of this file is to allow the keyword coloration of all keywords to be easily checked
keywordKEYWORD1 KEYWORD1
keywordKEYWORD2 KEYWORD2
keywordKEYWORD3 KEYWORD3
keywordLITERAL1 LITERAL1
keywordLITERAL2 LITERAL2

# 3 tabs are required between the keyword and the keyword identifier for these keyword types. This allows for other keyword identifiers or text to be included between which doesn't appear to have any effect, maybe for backwards compatibility?
keywordRESERVED_WORD RESERVED_WORD
keywordRESERVED_WORD_2 RESERVED_WORD_2
keywordDATA_TYPE DATA_TYPE
keywordPREPROCESSOR PREPROCESSOR

I cropped off the "keyword" part from the screen to avoid confusion.

Here's a dummy library I made that has an example sketch that uses all these keywords:

Ill upgrade to 1.8.3 right now and let you know.

EDIT: Upgraded, but no change LITERAL1 is still orange

EDIT2: Used your ThemeTest: Success LITERAL1 is now blue as it should be.

Thank you all

Jacques