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,) --- vis.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'vis.c') diff --git a/vis.c b/vis.c index c0da6ac..aa37cb8 100644 --- a/vis.c +++ b/vis.c @@ -385,8 +385,10 @@ static TextObject *moves_linewise[] = { }; /** functions to be called from keybindings */ -/* navigate jumplist either in forward (arg->i>0) or backward (arg->i<0) direction */ +/* navigate jump list either in forward (arg->i>0) or backward (arg->i<0) direction */ static void jumplist(const Arg *arg); +/* navigate change list either in forward (arg->i>0) or backward (arg->i<0) direction */ +static void changelist(const Arg *arg); static void macro_record(const Arg *arg); static void macro_replay(const Arg *arg); /* temporarily suspend the editor and return to the shell, type 'fg' to get back */ @@ -810,6 +812,16 @@ static void jumplist(const Arg *arg) { window_cursor_to(vis->win->win, pos); } +static void changelist(const Arg *arg) { + size_t pos; + if (arg->i > 0) + pos = editor_window_changelist_next(vis->win); + else + pos = editor_window_changelist_prev(vis->win); + if (pos != EPOS) + window_cursor_to(vis->win->win, pos); +} + static Macro *key2macro(const Arg *arg) { if (arg->i) return &vis->macros[arg->i]; -- cgit v1.2.3