Theme Syntax can't setup proper colors

Solved bugs are moved into this topic...
Post Reply
APEC
Posts: 18
Joined: 07.01.2021 19:39

Theme Syntax can't setup proper colors

Post by APEC »

Hello,
I'm trying to achieve color theme like in Blender.
And I'm mostly succeeded but in some cases I can't get proper result.
1. for syntax like "@classmethod"
blender https://imgur.com/yepuPHt
cudatext https://imgur.com/F7NKtCy

2. for syntax like "True/False" it also include "type"
blender https://imgur.com/qdxwAdw
cudatext https://imgur.com/RiL953W

Can we do something with this?
uvviewsoft
Posts: 392
Joined: 01.12.2020 13:46

Post by uvviewsoft »

Here we have 2 issues in Python lexer
1. "classmethod" is some sort of keyword (not keyword but special known word), so @classmethod is highlited as "symbol"+"spec word".
it's better that to highlite @word always with a purple.
because then @word is always purple, wherever "word" is special or not.
Ok?

2. lexer highlighted special words in any context, i just fixed the lexer to avoid it before "=" char.
APEC
Posts: 18
Joined: 07.01.2021 19:39

Post by APEC »

1. I'm not very well skilled with python, but I think "@world" should be always purple (in this case)

2. I think it should be separated id_color for "True False" state, and it will resolve issue
uvviewsoft
Posts: 392
Joined: 01.12.2020 13:46

Post by uvviewsoft »

OK, now @Id.id.id will be highlighted with special color (theme item TagId).
download last lexers from
https://github.com/Alexey-T/CudaText/tr ... ata/lexlib
to test it.

2. I didn't get your idea.
APEC
Posts: 18
Joined: 07.01.2021 19:39

Post by APEC »

uvviewsoft wrote: 2. I didn't get your idea.
Never mind, it works as expected, except this one word "type". I see where it stored, and can edit words list by myself.

1.Thanks! I will test it.
Update: Tested. Now all good. Thank you!
uvviewsoft
Posts: 392
Joined: 01.12.2020 13:46

Post by uvviewsoft »

lexer keywords-list editing isnot needed now. lexer highlights "type" only if not followed by '='.
Post Reply