diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-02-17 21:34:00 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-02-18 16:50:40 +0100 |
| commit | 498723377cbf5cdb36d8b64f41b219a515a84175 (patch) | |
| tree | dbd82e2cc0fe74f7e63859735a4febd14e09cff2 /vis.c | |
| parent | 55e285783ef99befcc01d7ed6f5594f87d6d8f6c (diff) | |
| download | vis-498723377cbf5cdb36d8b64f41b219a515a84175.tar.gz vis-498723377cbf5cdb36d8b64f41b219a515a84175.tar.xz | |
Add infrastructure to register custom text object functions
Diffstat (limited to 'vis.c')
| -rw-r--r-- | vis.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -378,6 +378,7 @@ void vis_free(Vis *vis) { for (int i = 0; i < VIS_MODE_INVALID; i++) map_free(vis_modes[i].bindings); array_release_full(&vis->motions); + array_release_full(&vis->textobjects); free(vis); } @@ -524,11 +525,13 @@ void action_do(Vis *vis, Action *a) { else c.range.start = c.range.end = pos; for (int i = 0; i < count; i++) { - Filerange r; + Filerange r = text_range_empty(); if (a->textobj->txt) r = a->textobj->txt(txt, pos); - else + else if (a->textobj->vis) r = a->textobj->vis(vis, txt, pos); + else if (a->textobj->user) + r = a->textobj->user(vis, win, a->textobj->data, pos); if (!text_range_valid(&r)) break; if (a->textobj->type & OUTER) { |
