Fix token coloring logic for special cases; also cooler sunlight theme

master
Allen Webster 2020-05-01 12:09:38 -07:00
parent 4f579180c1
commit 6dd43762c4
2 changed files with 23 additions and 25 deletions

View File

@ -534,27 +534,25 @@ get_token_color_cpp(Token token){
{
color = defcolor_float_constant;
}break;
default:
}
// specifics override generals
switch (token.sub_kind){
case TokenCppKind_LiteralTrue:
case TokenCppKind_LiteralFalse:
{
switch (token.sub_kind){
case TokenCppKind_LiteralTrue:
case TokenCppKind_LiteralFalse:
{
color = defcolor_bool_constant;
}break;
case TokenCppKind_LiteralCharacter:
case TokenCppKind_LiteralCharacterWide:
case TokenCppKind_LiteralCharacterUTF8:
case TokenCppKind_LiteralCharacterUTF16:
case TokenCppKind_LiteralCharacterUTF32:
{
color = defcolor_char_constant;
}break;
case TokenCppKind_PPIncludeFile:
{
color = defcolor_include;
}break;
}
color = defcolor_bool_constant;
}break;
case TokenCppKind_LiteralCharacter:
case TokenCppKind_LiteralCharacterWide:
case TokenCppKind_LiteralCharacterUTF8:
case TokenCppKind_LiteralCharacterUTF16:
case TokenCppKind_LiteralCharacterUTF32:
{
color = defcolor_char_constant;
}break;
case TokenCppKind_PPIncludeFile:
{
color = defcolor_include;
}break;
}
return(fcolor_id(color));

View File

@ -16,12 +16,12 @@ defcolor_text_default = 0xFF47474F;
defcolor_comment = 0xFF953FFF;
defcolor_comment_pop = {0xFF00C030, 0xFFF00000};
defcolor_keyword = 0xFF002255;
defcolor_str_constant = defcolor_keyword;
defcolor_str_constant = 0xFFE820E0;
defcolor_char_constant = defcolor_str_constant;
defcolor_int_constant = defcolor_str_constant;
defcolor_float_constant = defcolor_str_constant;
defcolor_bool_constant = defcolor_str_constant;
defcolor_include = defcolor_str_constant;
defcolor_int_constant = 0xFF20E8E0;
defcolor_float_constant = defcolor_int_constant;
defcolor_bool_constant = defcolor_int_constant;
defcolor_include = 0xFFF010F0;
defcolor_preproc = 0xFF000000;
defcolor_special_character = 0xFFFF00FF;
defcolor_ghost_character = 0xFF929292;