diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2014-01-05 15:14:58 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2014-01-05 15:14:58 +0000 |
| commit | aadbd390c780c2697eec611896578f616c995a70 (patch) | |
| tree | 2878d6f9e8b838c45fb0749602e7ddee18ad1736 /src/unicode.hh | |
| parent | 1e6fbf548b9df926a6e989f00a16aac794246648 (diff) | |
Use wide character function for categorizing codepoints
Previously we used the is... rather than isw...
These functions were not supporting non ascii characters correctly
Diffstat (limited to 'src/unicode.hh')
| -rw-r--r-- | src/unicode.hh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/unicode.hh b/src/unicode.hh index fb235fad..9485a27d 100644 --- a/src/unicode.hh +++ b/src/unicode.hh @@ -3,6 +3,7 @@ #include <cstdint> #include <ctype.h> +#include <wctype.h> namespace Kakoune { @@ -29,13 +30,13 @@ enum WordType { Word, WORD }; template<WordType word_type = Word> inline bool is_word(Codepoint c) { - return c == '_' or isalnum(c); + return c == '_' or iswalnum(c); } template<> inline bool is_word<WORD>(Codepoint c) { - return !is_blank(c) and !is_eol(c); + return not is_blank(c) and not is_eol(c); } inline bool is_punctuation(Codepoint c) |
