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.h | |
| 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.h')
| -rw-r--r-- | vis.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -242,6 +242,7 @@ enum VisMotion { VIS_MOVE_TOTILL_REVERSE, VIS_MOVE_SEARCH_FORWARD, VIS_MOVE_SEARCH_BACKWARD, + VIS_MOVE_LAST, /* denotes the end of all motions */ }; /* set motion to perform, the following take an additional argument: @@ -275,6 +276,12 @@ enum VisMotionType { /* force certain motion to behave in line or character wise mode */ void vis_motion_type(Vis *vis, enum VisMotionType); +/* register a motion function, if positive the return value can be used + * as an id for the vis_motion funntion. A negative return value indicates + * an error */ +int vis_motion_register(Vis*, enum VisMotionType, void *data, + size_t (*motion)(Vis*, Win*, void*, size_t pos)); + enum VisTextObject { VIS_TEXTOBJECT_INNER_WORD, VIS_TEXTOBJECT_OUTER_WORD, |
