aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2014-09-27 19:51:29 +0200
committerMarc André Tanner <mat@brain-dump.org>2014-09-27 19:51:29 +0200
commit521263a2c67d2b5df507858dcd240a9e42790780 (patch)
tree2967b3b921f4e5568825367bbeb367f3f918a19d /vis.c
parentab264837f7c127ba8ff4666f9c4ed94efd485af0 (diff)
downloadvis-521263a2c67d2b5df507858dcd240a9e42790780.tar.gz
vis-521263a2c67d2b5df507858dcd240a9e42790780.tar.xz
Implement 'zt', 'zz', 'zb'
In particular 'zb' might not work if there are wrapped lines involved.
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/vis.c b/vis.c
index f2da978..9127c9e 100644
--- a/vis.c
+++ b/vis.c
@@ -48,7 +48,7 @@ typedef union {
bool b;
int i;
const char *s;
- size_t (*m)(Win*); /* cursor movement based on window content */
+ void (*w)(Win*); /* generic window commands */
void (*f)(Editor*); /* generic editor commands */
} Arg;
@@ -449,6 +449,8 @@ static void wscroll(const Arg *arg);
static void wslide(const Arg *arg);
/* call editor function as indicated by arg->f */
static void call(const Arg *arg);
+/* call window function as indicated by arg->w */
+static void window(const Arg *arg);
/* quit editor, discard all changes */
static void quit(const Arg *arg);
@@ -981,6 +983,10 @@ static void call(const Arg *arg) {
arg->f(vis);
}
+static void window(const Arg *arg) {
+ arg->w(vis->win->win);
+}
+
static void insert(const Arg *arg) {
editor_insert_key(vis, arg->s, arg->s ? strlen(arg->s) : 0);
}