From c2cdafdd5c92f8caa4701257ba91dd7915054fbe Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 23 Jul 2025 01:15:45 +0300 Subject: if EX falis because of a dirty buffer, the buffer's id is now included in the error message --- src/ring.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/ring.c') diff --git a/src/ring.c b/src/ring.c index 0576545..72aab93 100644 --- a/src/ring.c +++ b/src/ring.c @@ -233,16 +233,20 @@ teco_ring_dirtify(void) teco_interface_info_update(teco_ring_current); } -gboolean -teco_ring_is_any_dirty(void) +/** Get id of first dirty buffer, or otherwise 0 */ +guint +teco_ring_get_first_dirty(void) { + guint id = 1; + for (teco_tailq_entry_t *cur = teco_ring_head.first; cur != NULL; cur = cur->next) { teco_buffer_t *buffer = (teco_buffer_t *)cur; if (buffer->dirty) - return TRUE; + return id; + id++; } - return FALSE; + return 0; } gboolean -- cgit v1.2.3