commit 10ba804f935c024ffe37b59689c888ef34044f1d
parent 9208de446725feeee9da95289d3080d9e87390a2
Author: Claudio Alessi <smoppy@gmail.com>
Date: Wed, 21 Jan 2026 15:07:14 +0100
Add cell flags support in strict mode.
Diffstat:
2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/edo.c b/edo.c
@@ -426,7 +426,6 @@ view_place_cursor(View *v) {
Line *l;
int x, y;
- x = v->col_off;
l = buffer_get_line(v->buf, v->line_idx);
if(l) {
x = view_idx2col(v, l, v->col_idx);
diff --git a/tui.c b/tui.c
@@ -317,10 +317,25 @@ tui_draw_line(UI *ui, int x, int y, Cell *cells, int count) {
txt = cell_get_text(cells + i, ui->pool.data);
/* TODO: temp code for testing, we'll se how to deal with this later */
- if(txt[0] == '\t')
+ if(txt[0] == '\t') {
ab_printf(&frame, "%*s", cells[i].width, " ");
- else
+ } else {
+
+ if(cells[i].flags & CELL_TRUNC_L) {
+ ab_write(&frame, "<", 1);
+ for(int j = 1; j < cells[i].width; ++j)
+ ab_write(&frame, ".", 1);
+ continue;
+ }
+ if(cells[i].flags & CELL_TRUNC_R) {
+ ab_write(&frame, ">", 1);
+ for(int j = 1; j < cells[i].width; ++j)
+ ab_write(&frame, ".", 1);
+ continue;
+ }
+
ab_write(&frame, txt, cells[i].len);
+ }
}
ab_write(&frame, CLEARRIGHT, strlen(CLEARRIGHT));
}
@@ -359,8 +374,8 @@ tui_init(void) {
setbuf(stdout, NULL);
ioctl(0, TIOCGWINSZ, &ws);
- compat_mode = 1; /* TODO: auto-detect */
- split_ris = 0; /* split RIS clusters */
+ compat_mode = 0; /* TODO: auto-detect */
+ split_ris = compat_mode && 0; /* split RIS clusters */
}
int