diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-02-17 20:59:26 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-02-18 16:50:40 +0100 |
| commit | 44ff1f95ecc14521fb2a1cec67a628140fc46598 (patch) | |
| tree | 61e5439273640ebd33747637d6e8359a1dee056b /vis.c | |
| parent | 58df45177a7db63223c8459be7aef727a0cc22f7 (diff) | |
| download | vis-44ff1f95ecc14521fb2a1cec67a628140fc46598.tar.gz vis-44ff1f95ecc14521fb2a1cec67a628140fc46598.tar.xz | |
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(...)
Diffstat (limited to 'vis.c')
| -rw-r--r-- | vis.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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; } |
