From 44ff1f95ecc14521fb2a1cec67a628140fc46598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 17 Feb 2016 20:59:26 +0100 Subject: Add infrastructure to add custom motion functions A motion function can be registered with vis_motion_register(...) the returned id (if non negative) can then be used as an argument to vis_motion(...) --- vis.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'vis.c') diff --git a/vis.c b/vis.c index 35516de..ccea1f1 100644 --- a/vis.c +++ b/vis.c @@ -377,6 +377,7 @@ void vis_free(Vis *vis) { buffer_release(&vis->input_queue); for (int i = 0; i < VIS_MODE_INVALID; i++) map_free(vis_modes[i].bindings); + array_release_full(&vis->motions); free(vis); } @@ -488,6 +489,8 @@ void action_do(Vis *vis, Action *a) { pos = a->movement->view(vis, view); else if (a->movement->win) pos = a->movement->win(vis, win, pos); + else if (a->movement->user) + pos = a->movement->user(vis, win, a->movement->data, pos); if (pos == EPOS || a->movement->type & IDEMPOTENT) break; } -- cgit v1.2.3