diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-07-23 01:15:45 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-07-23 01:15:45 +0300 |
commit | c2cdafdd5c92f8caa4701257ba91dd7915054fbe (patch) | |
tree | b8e0d94a978583d92c85c6eb5083d088485e8698 /src/ring.c | |
parent | 63a314144a36691a57c2e82fe2f3da008c403aba (diff) | |
download | sciteco-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.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -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 |