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

This commit is contained in:
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; color = defcolor_float_constant;
}break; }break;
default: }
// specifics override generals
switch (token.sub_kind){
case TokenCppKind_LiteralTrue:
case TokenCppKind_LiteralFalse:
{ {
switch (token.sub_kind){ color = defcolor_bool_constant;
case TokenCppKind_LiteralTrue: }break;
case TokenCppKind_LiteralFalse: case TokenCppKind_LiteralCharacter:
{ case TokenCppKind_LiteralCharacterWide:
color = defcolor_bool_constant; case TokenCppKind_LiteralCharacterUTF8:
}break; case TokenCppKind_LiteralCharacterUTF16:
case TokenCppKind_LiteralCharacter: case TokenCppKind_LiteralCharacterUTF32:
case TokenCppKind_LiteralCharacterWide: {
case TokenCppKind_LiteralCharacterUTF8: color = defcolor_char_constant;
case TokenCppKind_LiteralCharacterUTF16: }break;
case TokenCppKind_LiteralCharacterUTF32: case TokenCppKind_PPIncludeFile:
{ {
color = defcolor_char_constant; color = defcolor_include;
}break;
case TokenCppKind_PPIncludeFile:
{
color = defcolor_include;
}break;
}
}break; }break;
} }
return(fcolor_id(color)); return(fcolor_id(color));

View File

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