Page 1 of 1
Theme Syntax can't setup proper colors
Posted: 08.01.2021 11:35
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?
Posted: 08.01.2021 11:55
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.
Posted: 08.01.2021 13:08
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
Posted: 08.01.2021 14:23
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.
Posted: 08.01.2021 17:10
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!
Posted: 09.01.2021 11:03
by uvviewsoft
lexer keywords-list editing isnot needed now. lexer highlights "type" only if not followed by '='.