Commit d20b9500 authored by Matan Ziv-Av's avatar Matan Ziv-Av
Browse files

When a character is sent to the screen, calculate and save its script

A character is sent once, and rendered many times, so this is the best
place for the calculation, though it is used only when rendering.
parent 559e7b70
......@@ -1246,6 +1246,14 @@ notcombine:
if (Character::emojiPresentation(c)) {
currentChar.flags |= EF_EMOJI_REPRESENTATION;
}
if (c <= '~' && c > ' ') {
currentChar.flags |= EF_ASCII_WORD;
}
if (c >= 0x900
&& (c <= 0x109f || (c >= 0x1700 && c <= 0x18af) || (c >= 0x1900 && c <= 0x1aaf) || (c >= 0xa800 && c <= 0xa82f) || (c >= 0xa840 && c <= 0xa95f)
|| (c >= 0xa980 && c <= 0xaaff) || (c >= 0xabc0 && c <= 0xabff) || (c >= 0x10a00 && c <= 0x10a5f) || (c >= 0x11000 && c <= 0x11fff))) {
currentChar.flags |= EF_BRAHMIC_WORD;
}
_lastDrawnChar = c;
......
......@@ -120,6 +120,8 @@ const ExtraFlags EF_REPL_OUTPUT = (3 << 1);
const ExtraFlags EF_UNDERLINE_COLOR = (15 << 3);
const ExtraFlags EF_UNDERLINE_COLOR_1 = (1 << 3);
const ExtraFlags EF_EMOJI_REPRESENTATION = (1 << 7);
const ExtraFlags EF_ASCII_WORD = (1 << 8);
const ExtraFlags EF_BRAHMIC_WORD = (1 << 9);
#define SetULColor(f, m) (((f) & ~EF_UNDERLINE_COLOR) | ((m) * EF_UNDERLINE_COLOR_1))
#define setRepl(f, m) (((f) & ~EF_REPL) | ((m) * EF_REPL_PROMPT))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment