From 2854984c790af37569b79f5138e07847702cdb34 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 26 Feb 2013 18:54:11 +0100 Subject: [PATCH] use std::isalnum for is_word implementation in order to support unicode --- src/unicode.hh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/unicode.hh b/src/unicode.hh index 8da688e4..49b2755b 100644 --- a/src/unicode.hh +++ b/src/unicode.hh @@ -2,6 +2,7 @@ #define unicode_hh_INCLUDED #include +#include 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)