Compare commits

...

3 Commits

Author SHA1 Message Date
dundargoc
3f240b0c41
Merge f1c72b2839 into deac7df80a 2024-09-12 22:52:35 +02:00
dundargoc
f1c72b2839 test: add vterm tests [skip ci] 2024-09-11 14:14:54 +02:00
dundargoc
cf49799a57 refactor: remove bitfields 2024-09-11 14:13:31 +02:00
2 changed files with 40 additions and 21 deletions

View File

@ -219,9 +219,9 @@ typedef enum {
typedef struct {
const char *str;
size_t len : 30;
bool initial : 1;
bool final : 1;
size_t len;
bool initial;
bool final;
} VTermStringFragment;
typedef union {
@ -293,15 +293,15 @@ typedef enum {
typedef struct {
const uint32_t *chars;
int width;
unsigned int protected_cell:1; /* DECSCA-protected against DECSEL/DECSED */
unsigned int dwl:1; /* DECDWL or DECDHL double-width line */
unsigned int dhl:2; /* DECDHL double-height line (1=top 2=bottom) */
unsigned int protected_cell; /* DECSCA-protected against DECSEL/DECSED */
unsigned int dwl; /* DECDWL or DECDHL double-width line */
unsigned int dhl; /* DECDHL double-height line (1=top 2=bottom) */
} VTermGlyphInfo;
typedef struct {
unsigned int doublewidth:1; /* DECDWL or DECDHL line */
unsigned int doubleheight:2; /* DECDHL line (1=top 2=bottom) */
unsigned int continuation:1; /* Line is a flow continuation of the previous */
unsigned int doublewidth; /* DECDWL or DECDHL line */
unsigned int doubleheight; /* DECDHL line (1=top 2=bottom) */
unsigned int continuation; /* Line is a flow continuation of the previous */
} VTermLineInfo;
/* Copies of VTermState fields that the 'resize' callback might have reason to
@ -499,18 +499,18 @@ void vterm_state_send_selection(VTermState *state, VTermSelectionMask mask, VTer
// ------------
typedef struct {
unsigned int bold : 1;
unsigned int underline : 2;
unsigned int italic : 1;
unsigned int blink : 1;
unsigned int reverse : 1;
unsigned int conceal : 1;
unsigned int strike : 1;
unsigned int font : 4; /* 0 to 9 */
unsigned int dwl : 1; /* On a DECDWL or DECDHL line */
unsigned int dhl : 2; /* On a DECDHL line (1=top 2=bottom) */
unsigned int small : 1;
unsigned int baseline : 2;
unsigned int bold;
unsigned int underline;
unsigned int italic;
unsigned int blink;
unsigned int reverse;
unsigned int conceal;
unsigned int strike;
unsigned int font; /* 0 to 9 */
unsigned int dwl; /* On a DECDWL or DECDHL line */
unsigned int dhl; /* On a DECDHL line (1=top 2=bottom) */
unsigned int small;
unsigned int baseline;
} VTermScreenCellAttrs;
enum {

19
test/unit/vterm_spec.lua Normal file
View File

@ -0,0 +1,19 @@
local t = require('test.unit.testutil')
local itp = t.gen_itp(it)
local vterm = t.cimport('./src/vterm/vterm.h')
-- local function init()
-- -- if(streq(line, "INIT")) {
-- -- if(!vt)
-- local vt = vterm.vterm_new(25, 80);
-- --
-- -- vterm_output_set_callback(vt, term_output, NULL);
-- -- }
-- end
describe('vterm', function()
itp('02parser', function()
print('wat')
end)
end)