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>2013-01-16 08:05:01 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-01-16 08:05:01 +0400
commitd0e65f2bf4d5e2140752c0695d19507ffee1ebd8 (patch)
tree419a3c76aecdd26113b8649f64e3198fc23b403e /source/blender/editors/space_text/text_format.c
parent6fd5645d56b9e2d34a683fa21139d975c8be02aa (diff)
text syntax highlighting: don't use utf8 stepping if we know the text is ascii
Diffstat (limited to 'source/blender/editors/space_text/text_format.c')
-rw-r--r--source/blender/editors/space_text/text_format.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/editors/space_text/text_format.c b/source/blender/editors/space_text/text_format.c
index fc8002ba0e4..d7691642070 100644
--- a/source/blender/editors/space_text/text_format.c
+++ b/source/blender/editors/space_text/text_format.c
@@ -168,6 +168,25 @@ void text_format_fill(const char **str_p, char **fmt_p, const char type, const i
*str_p = str;
*fmt_p = fmt;
}
+/**
+ * ascii version of #text_format_fill,
+ * use when we no the text being stepped over is ascii (as is the case for most keywords)
+ */
+void text_format_fill_ascii(const char **str_p, char **fmt_p, const char type, const int len)
+{
+ const char *str = *str_p;
+ char *fmt = *fmt_p;
+
+ memset(fmt, type, len);
+
+ str += len - 1;
+ fmt += len - 1;
+
+ BLI_assert(*str != '\0');
+
+ *str_p = str;
+ *fmt_p = fmt;
+}
/* *** Registration *** */
static ListBase tft_lb = {NULL, NULL};