From 521263a2c67d2b5df507858dcd240a9e42790780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sat, 27 Sep 2014 19:51:29 +0200 Subject: Implement 'zt', 'zz', 'zb' In particular 'zb' might not work if there are wrapped lines involved. --- vis.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'vis.c') 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); } -- cgit v1.2.3