diff options
author | michi_cc <michi_cc@openttd.org> | 2013-08-05 20:35:27 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2013-08-05 20:35:27 +0000 |
commit | e7dc14b25af4b2802a956dd1cd99c187fb4acb56 (patch) | |
tree | c9fcb2f1af8e1ec6d5d6ebe03d4c30eb00eb1fed /src/string_func.h | |
parent | 33f3cf3a5daeaf9e6e5b5414696f93676249bc41 (diff) | |
download | openttd-e7dc14b25af4b2802a956dd1cd99c187fb4acb56.tar.xz |
(svn r25652) -Fix: Improve text caret movement for complex scripts.
Diffstat (limited to 'src/string_func.h')
-rw-r--r-- | src/string_func.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/string_func.h b/src/string_func.h index 25608889d..b0a42b808 100644 --- a/src/string_func.h +++ b/src/string_func.h @@ -147,6 +147,13 @@ static inline char *Utf8PrevChar(char *s) return ret; } +static inline const char *Utf8PrevChar(const char *s) +{ + const char *ret = s; + while (IsUtf8Part(*--ret)) {} + return ret; +} + size_t Utf8StringLength(const char *s); /** |