aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-06-24 17:15:53 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-06-24 17:15:53 +0000
commit9a7c6bdcf2ed686e41a15bbf6a3fbd9e8517dc6a (patch)
tree170042d5da1c34fd126f2405324d6a159ae699f3
parentcomposed: insert: require key to be unique (diff)
term: CELL_COMB_CHARS chars are keys, not indices -> more range is better
Bump the available key range to 30 bits. This helps reduce key collisions when handling a large amount of grapheme clusters.
-rw-r--r--terminal.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/terminal.h b/terminal.h
index 00c4221f..385b36e0 100644
--- a/terminal.h
+++ b/terminal.h
@@ -51,9 +51,10 @@ struct attributes {
};
static_assert(sizeof(struct attributes) == 8, "VT attribute struct too large");
-#define CELL_COMB_CHARS_LO 0x40000000ul
-#define CELL_COMB_CHARS_HI 0x400ffffful
-#define CELL_SPACER 0x40100000ul
+/* Last valid Unicode code point is 0x0010FFFFul */
+#define CELL_COMB_CHARS_LO 0x00200000ul
+#define CELL_COMB_CHARS_HI (CELL_COMB_CHARS_LO + 0x3fffffff)
+#define CELL_SPACER (CELL_COMB_CHARS_HI + 1)
struct cell {
wchar_t wc;