use std::isalnum for is_word implementation in order to support unicode
This commit is contained in:
parent
b68cc3cd3c
commit
2854984c79
|
@ -2,6 +2,7 @@
|
||||||
#define unicode_hh_INCLUDED
|
#define unicode_hh_INCLUDED
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include <locale>
|
||||||
|
|
||||||
namespace Kakoune
|
namespace Kakoune
|
||||||
{
|
{
|
||||||
|
@ -10,10 +11,7 @@ using Codepoint = uint32_t;
|
||||||
|
|
||||||
inline bool is_word(Codepoint c)
|
inline bool is_word(Codepoint c)
|
||||||
{
|
{
|
||||||
return (c >= '0' and c <= '9') or
|
return c == '_' or std::isalnum((wchar_t)c, std::locale());
|
||||||
(c >= 'a' and c <= 'z') or
|
|
||||||
(c >= 'A' and c <= 'Z') or
|
|
||||||
c == '_';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool is_eol(Codepoint c)
|
inline bool is_eol(Codepoint c)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user