Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-12-30 05:26:31 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-12-30 05:26:31 +0400
commite12354c4c5850864f925d22f53ec31578384bc63 (patch)
treebc7966010e1f3d01e255bd56476bb71e3f10c0c0 /source/blender/editors/space_text
parent099d8c93904747fa39857684dce2bd228c3462eb (diff)
add syntax highlighting color for symbols
Diffstat (limited to 'source/blender/editors/space_text')
-rw-r--r--source/blender/editors/space_text/text_draw.c2
-rw-r--r--source/blender/editors/space_text/text_format_osl.c22
-rw-r--r--source/blender/editors/space_text/text_format_py.c4
3 files changed, 5 insertions, 23 deletions
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index 01adf6a4107..2256c1c7e25 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -120,7 +120,7 @@ static void format_draw_color(char formatchar)
case FMT_TYPE_WHITESPACE:
break;
case FMT_TYPE_SYMBOL:
- UI_ThemeColorBlend(TH_TEXT, TH_BACK, 0.5f);
+ UI_ThemeColor(TH_SYNTAX_S);
break;
case FMT_TYPE_COMMENT:
UI_ThemeColor(TH_SYNTAX_C);
diff --git a/source/blender/editors/space_text/text_format_osl.c b/source/blender/editors/space_text/text_format_osl.c
index 433ff0a035b..38903d65ec0 100644
--- a/source/blender/editors/space_text/text_format_osl.c
+++ b/source/blender/editors/space_text/text_format_osl.c
@@ -154,8 +154,8 @@ static int txtfmt_osl_find_preprocessor(const char *string)
{
if (string[0] == '#') {
int i = 1;
- /* whitespace is ok '# foo' */
- while (string[i] == '\t' || string[i] == ' ') {
+ /* Whitespace is ok '# foo' */
+ while (text_check_whitespace(string[i])) {
i++;
}
while (text_check_identifier(string[i])) {
@@ -166,24 +166,6 @@ static int txtfmt_osl_find_preprocessor(const char *string)
return -1;
}
-/* not in OSL, keep for now though */
-#if 0
-static int txtfmt_osl_find_bool(const char *string)
-{
- int i, len;
-
- if (STR_LITERAL_STARTSWITH(string, "None", len)) i = len;
- else if (STR_LITERAL_STARTSWITH(string, "True", len)) i = len;
- else if (STR_LITERAL_STARTSWITH(string, "False", len)) i = len;
- else i = 0;
-
- /* If next source char is an identifier (eg. 'i' in "Nonetheless") no match */
- if (i == 0 || text_check_identifier(string[i]))
- return -1;
- return i;
-}
-#endif
-
static void txtfmt_osl_format_line(SpaceText *st, TextLine *line, const int do_next)
{
FlattenString fs;
diff --git a/source/blender/editors/space_text/text_format_py.c b/source/blender/editors/space_text/text_format_py.c
index 02b67c32052..a78dabbfb9b 100644
--- a/source/blender/editors/space_text/text_format_py.c
+++ b/source/blender/editors/space_text/text_format_py.c
@@ -127,8 +127,8 @@ static int txtfmt_py_find_decorator(const char *string)
{
if (string[0] == '@') {
int i = 1;
- /* whitespace is ok '@ foo' */
- while (string[i] == '\t' || string[i] == ' ') {
+ /* Whitespace is ok '@ foo' */
+ while (text_check_whitespace(string[i])) {
i++;
}
while (text_check_identifier(string[i])) {