From d3b3e218edcaa950477645a9add92c83cd0543b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 6 Jan 2015 21:28:39 +0100 Subject: Rudimentary change list (accessible via g; and g,) --- text.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'text.c') diff --git a/text.c b/text.c index 7d17bbf..9afab01 100644 --- a/text.c +++ b/text.c @@ -1177,6 +1177,18 @@ void text_mark_intern_clear_all(Text *txt) { text_mark_intern_clear(txt, mark); } +size_t text_history_get(Text *txt, size_t index) { + for (Action *a = txt->current_action ? txt->current_action : txt->undo; a; a = a->next) { + if (index-- == 0) { + Change *c = a->change; + while (c && c->next) + c = c->next; + return c ? c->pos : EPOS; + } + } + return EPOS; +} + int text_fd_get(Text *txt) { return txt->fd; } -- cgit v1.2.3