Allow three combining chars per cell
Makes use of otherwise wasted padding in the CPUCell struct
This commit is contained in:
parent
1a2d9c6fba
commit
2b3be147e6
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#define PY_SSIZE_T_CLEAN
|
#define PY_SSIZE_T_CLEAN
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
|
#include <assert.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
@ -163,12 +164,14 @@ typedef struct {
|
|||||||
sprite_index sprite_x, sprite_y, sprite_z;
|
sprite_index sprite_x, sprite_y, sprite_z;
|
||||||
CellAttrs attrs;
|
CellAttrs attrs;
|
||||||
} GPUCell;
|
} GPUCell;
|
||||||
|
static_assert(sizeof(GPUCell) == 20, "Fix the ordering of GPUCell");
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char_type ch;
|
char_type ch;
|
||||||
combining_type cc_idx[2];
|
|
||||||
hyperlink_id_type hyperlink_id;
|
hyperlink_id_type hyperlink_id;
|
||||||
|
combining_type cc_idx[3];
|
||||||
} CPUCell;
|
} CPUCell;
|
||||||
|
static_assert(sizeof(CPUCell) == 12, "Fix the ordering of CPUCell");
|
||||||
|
|
||||||
typedef enum { UNKNOWN_PROMPT_KIND = 0, PROMPT_START = 1, SECONDARY_PROMPT = 2, OUTPUT_START = 3 } PromptKind;
|
typedef enum { UNKNOWN_PROMPT_KIND = 0, PROMPT_START = 1, SECONDARY_PROMPT = 2, OUTPUT_START = 3 } PromptKind;
|
||||||
typedef union LineAttrs {
|
typedef union LineAttrs {
|
||||||
|
|||||||
@ -182,9 +182,11 @@ class TestDataTypes(BaseTest):
|
|||||||
l0.add_combining_char(0, '\U000e0100')
|
l0.add_combining_char(0, '\U000e0100')
|
||||||
self.ae(l0[0], ' \u0300\U000e0100')
|
self.ae(l0[0], ' \u0300\U000e0100')
|
||||||
l0.add_combining_char(0, '\u0302')
|
l0.add_combining_char(0, '\u0302')
|
||||||
self.ae(l0[0], ' \u0300\u0302')
|
self.ae(l0[0], ' \u0300\U000e0100\u0302')
|
||||||
|
l0.add_combining_char(0, '\u0301')
|
||||||
|
self.ae(l0[0], ' \u0300\U000e0100\u0301')
|
||||||
self.ae(l0[1], '\0')
|
self.ae(l0[1], '\0')
|
||||||
self.ae(str(l0), ' \u0300\u0302')
|
self.ae(str(l0), ' \u0300\U000e0100\u0301')
|
||||||
t = 'Testing with simple text'
|
t = 'Testing with simple text'
|
||||||
lb = LineBuf(2, len(t))
|
lb = LineBuf(2, len(t))
|
||||||
l0 = lb.line(0)
|
l0 = lb.line(0)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user