diff options
| author | Maxime Coste <mawww@kakoune.org> | 2024-08-09 18:33:32 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2024-08-12 20:02:11 +1000 |
| commit | 6ed01f402b3a54495c8d9e462b7674864fbbe402 (patch) | |
| tree | 2a5c3fcb1da1c8577fe58a87fdd3376c44b8ba49 /src/unicode.hh | |
| parent | 1b2100753e4bdc65b1c6a78662ab5eeb7eaaa8d3 (diff) | |
Reduce headers dependency graph
Move more code into the implementation files to reduce the amount
of code pulled by headers.
Diffstat (limited to 'src/unicode.hh')
| -rw-r--r-- | src/unicode.hh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/unicode.hh b/src/unicode.hh index 0acf4005..5ce63f4b 100644 --- a/src/unicode.hh +++ b/src/unicode.hh @@ -5,7 +5,6 @@ #include <cwchar> #include "array_view.hh" -#include "ranges.hh" #include "units.hh" namespace Kakoune @@ -75,8 +74,12 @@ enum WordType { Word, WORD }; template<WordType word_type = Word> inline bool is_word(Codepoint c, ConstArrayView<Codepoint> extra_word_chars = {'_'}) noexcept { - return (c < 128 ? is_basic_alpha(c) or is_basic_digit(c) : iswalnum((wchar_t)c)) or - contains(extra_word_chars, c); + if (c < 128 ? is_basic_alpha(c) or is_basic_digit(c) : iswalnum((wchar_t)c)) + return true; + for (auto cp : extra_word_chars) + if (c == cp) + return true; + return false; } template<> |
