aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ring.c
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2025-07-23 01:15:45 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2025-07-23 01:15:45 +0300
commitc2cdafdd5c92f8caa4701257ba91dd7915054fbe (patch)
treeb8e0d94a978583d92c85c6eb5083d088485e8698 /src/ring.c
parent63a314144a36691a57c2e82fe2f3da008c403aba (diff)
downloadsciteco-c2cdafdd5c92f8caa4701257ba91dd7915054fbe.tar.gz
if EX falis because of a dirty buffer, the buffer's id is now included in the error message
Diffstat (limited to 'src/ring.c')
-rw-r--r--src/ring.c12
1 files changed, 8 insertions, 4 deletions
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