Commit: 79037dd472b78007572b4f0a377dc7ae57d9d9d3
Parent: 7759257a058c2f40273ea50a03692242a7f7cadd
Author: Randy Palamar
Date: Tue, 9 Jul 2024 20:36:30 -0600
style
Diffstat:
2 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/terminal.c b/terminal.c
@@ -85,6 +85,14 @@ line_length(Line *l)
return l->end - l->start;
}
+static s8
+line_to_s8(Line *l)
+{
+ ASSERT(l->start <= l->end);
+ s8 result = {.len = l->end - l->start, .data = l->start};
+ return result;
+}
+
static void
feed_line(LineBuf *lb, u8 *position, CellStyle cursor_state)
{
@@ -155,8 +163,8 @@ static void
cursor_reset(Term *t)
{
//(Colour){.rgba = 0x1e9e33ff};
- t->cursor.state.fg = g_colours.data[g_colours.fgidx];
- t->cursor.state.bg = g_colours.data[g_colours.bgidx];
+ t->cursor.state.fg = g_colours.data[g_colours.fgidx];
+ t->cursor.state.bg = g_colours.data[g_colours.bgidx];
t->cursor.state.attr = ATTR_NULL;
}
@@ -738,14 +746,6 @@ split_raw_input_to_lines(Term *t, s8 raw)
return parsed_lines;
}
-static s8
-line_to_s8(Line *l)
-{
- ASSERT(l->start <= l->end);
- s8 result = {.len = l->end - l->start, .data = l->start};
- return result;
-}
-
static void
push_newline(Term *t)
{
@@ -759,8 +759,7 @@ push_newline(Term *t)
static void
push_tab(Term *t)
{
- u32 col = t->cursor.col;
- u32 advance = g_tabstop - (col % g_tabstop);
+ u32 advance = g_tabstop - (t->cursor.col % g_tabstop);
fb_clear_region(t, t->cursor.row, t->cursor.row, t->cursor.col, t->cursor.col + advance);
cursor_step_column(t, advance);
}
@@ -768,7 +767,7 @@ push_tab(Term *t)
static void
push_line(Term *t, Line *line, Arena a)
{
- s8 l = line_to_s8(line);
+ s8 l = line_to_s8(line);
t->cursor.state = line->cursor_state;
diff --git a/vtgl.c b/vtgl.c
@@ -230,7 +230,7 @@ push_cell(RenderPushBuffer *rpb, GLCtx *gl, Cell c, Rect r, f32 font_text_dy)
.y = r.pos.y + g.delta.y + font_text_dy,
};
- rpb->texscales[idx] = (v2){0};
+ rpb->texscales[idx + 0] = (v2){0};
rpb->texscales[idx + 1] = (v2){
.x = g.size.w / MAX_FONT_SIZE,
.y = g.size.h / MAX_FONT_SIZE,