From 37f020979b7e71b1be8624b4570241c004fc9a95 Mon Sep 17 00:00:00 2001 From: WormHeamer Date: Fri, 2 Jan 2026 03:11:17 -0500 Subject: show non-file buffers as italic --- main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 3b0ee82..151f2cd 100644 --- a/main.c +++ b/main.c @@ -529,6 +529,7 @@ void draw_buf(EditBuf *eb) { VuiAttr txt = A_DEFAULT; VuiAttr trailsp = BG_BLUE | FG_DEFAULT; VuiAttr sel = norm | A_REVERSE; + if (eb->type != ED_BUF_FILE) txt |= A_ITALIC; vui_clear(); { @@ -540,11 +541,8 @@ void draw_buf(EditBuf *eb) { VuiAttr a = i == e.bufi ? sel : norm; Str p = basename(b->path); x += vui_aprintf(x, y, a, " %.*s", (int)p.n, p.s); - if (b->type != ED_BUF_SCRATCH && b->txt->ptbl.dirty) { - x += vui_putsa(x, y, "* ", a); - } else { - vui_chra(x++, y, ' ', a); - } + if (b->type != ED_BUF_SCRATCH && b->txt->ptbl.dirty) vui_chra(x++, y, '*', a); + vui_chra(x++, y, ' ', a); } int n = COLS; if (e.msg.n) { @@ -1608,6 +1606,8 @@ void mode_key_normal(Editor *e, u32 c) { void mode_key_insert(Editor *e, u32 c) { EditBuf *eb = &e->buf[e->bufi]; + if (c != KEY_ESC && eb->txt->readonly) + e->msg = S("readonly buffer"); switch (c) { case KEY_ESC: if (txt_after(eb->cur, start_of_line(eb->cur))) { -- cgit v1.2.3