use std::isalnum for is_word implementation in order to support unicode

This commit is contained in:
Maxime Coste 2013-02-26 18:54:11 +01:00
parent b68cc3cd3c
commit 2854984c79

View File

@ -2,6 +2,7 @@
#define unicode_hh_INCLUDED
#include <cstdint>
#include <locale>
namespace Kakoune
{
@ -10,10 +11,7 @@ using Codepoint = uint32_t;
inline bool is_word(Codepoint c)
{
return (c >= '0' and c <= '9') or
(c >= 'a' and c <= 'z') or
(c >= 'A' and c <= 'Z') or
c == '_';
return c == '_' or std::isalnum((wchar_t)c, std::locale());
}
inline bool is_eol(Codepoint c)