diff options
| author | WormHeamer | 2026-01-02 03:11:17 -0500 |
|---|---|---|
| committer | WormHeamer | 2026-01-02 03:11:17 -0500 |
| commit | 37f020979b7e71b1be8624b4570241c004fc9a95 (patch) | |
| tree | 330edc07fc317b0c2ef579be30b37004f2b5d73d | |
| parent | 0485e17d12e7ff38462835674c4aa652e82e6cfa (diff) | |
show non-file buffers as italic
| -rw-r--r-- | main.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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))) { |
