From 73f33b7f6b57e3e6848f159b5f9a543326548116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 6 Aug 2015 12:54:16 +0200 Subject: vis: implement gv to restore last selection --- vis.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'vis.c') diff --git a/vis.c b/vis.c index d6cbdbb..a4917e9 100644 --- a/vis.c +++ b/vis.c @@ -373,6 +373,8 @@ static void movement(const Arg *arg); static void textobj(const Arg *arg); /* move to the other end of selected text */ static void selection_end(const Arg *arg); +/* restore least recently used selection */ +static void selection_restore(const Arg *arg); /* use register indicated by arg->i for the current operator */ static void reg(const Arg *arg); /* perform a movement to mark arg->i */ @@ -1075,6 +1077,12 @@ static void selection_end(const Arg *arg) { view_cursors_selection_swap(c); } +static void selection_restore(const Arg *arg) { + for (Cursor *c = view_cursors(vis->win->view); c; c = view_cursors_next(c)) + view_cursors_selection_restore(c); + switchmode(&(const Arg){ .i = VIS_MODE_VISUAL }); +} + static void reg(const Arg *arg) { vis->action.reg = &vis->registers[arg->i]; } -- cgit v1.2.3