From 0c89fb700957e411885e7e7835e15f441e8b5e84 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Tue, 23 Dec 2025 13:54:17 +0100 Subject: fixed clicking the "(Unnamed)" buffer in 0EB popups * When constructing the list of popup items, the unnamed buffer is stored as the empty string instead of a prerendered "(Unnamed)". Using the empty string simplifies autocompletions, which will actually have to insert nothing at all (in addition to terminating the string). * Since unnamed buffers are now special in the popup list, we can render them with special icons as well. Currently, only on Curses we use a file symbol with a question mark. There doesn't appear to be a fitting standard Freedesktop icon to use on GTK and there isn't even any fitting standard emblem to lay over the default file icon. --- src/ring.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/ring.c') diff --git a/src/ring.c b/src/ring.c index bc04e50..22db7ce 100644 --- a/src/ring.c +++ b/src/ring.c @@ -517,11 +517,10 @@ teco_state_edit_file_initial(teco_machine_main_t *ctx, GError **error) ctx->flags.allow_filename = TRUE; if (id == 0) { - for (teco_buffer_t *cur = teco_ring_first(); cur; cur = teco_buffer_next(cur)) { - const gchar *filename = cur->filename ? : "(Unnamed)"; - teco_interface_popup_add(TECO_POPUP_FILE, filename, - strlen(filename), cur == teco_ring_current); - } + for (teco_buffer_t *cur = teco_ring_first(); cur; cur = teco_buffer_next(cur)) + teco_interface_popup_add(TECO_POPUP_FILE, cur->filename, + cur->filename ? strlen(cur->filename) : 0, + cur == teco_ring_current); teco_interface_popup_show(0); } else if (id > 0) { -- cgit v1.2.3