aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-08-06 12:54:16 +0200
committerMarc André Tanner <mat@brain-dump.org>2015-08-06 13:45:08 +0200
commit73f33b7f6b57e3e6848f159b5f9a543326548116 (patch)
treeef9018fa224272cf5b781cd36501e84fff9ebabd /vis.c
parentbb1ca1631def9be20da34af66b11c48daab09313 (diff)
downloadvis-73f33b7f6b57e3e6848f159b5f9a543326548116.tar.gz
vis-73f33b7f6b57e3e6848f159b5f9a543326548116.tar.xz
vis: implement gv to restore last selection
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c8
1 files changed, 8 insertions, 0 deletions
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];
}