vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 4459e6fb6a65a23ec9dc6a35915402f237c236e8 parent 5953428fa4771c6090944ae7e551ccb3e7b11ab8 Author: Marc André Tanner <mat@brain-dump.org> Date: Sun, 25 Oct 2015 21:49:01 +0100 vis: introduce vis_motion_type API Diffstat:
| M | vis.c | | | 6 | +++++- |
| M | vis.h | | | 7 | +++++++ |
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/vis.c b/vis.c @@ -908,7 +908,7 @@ static const char *gotoline(Vis *vis, const char *keys, const Arg *arg) { } static const char *motiontype(Vis *vis, const char *keys, const Arg *arg) { - vis->action.type = arg->i; + vis_motion_type(vis, arg->i); return keys; } @@ -2888,3 +2888,7 @@ void vis_mark_set(Vis *vis, enum VisMark mark, size_t pos) { if (mark < LENGTH(file->marks)) file->marks[mark] = text_mark_set(file->text, pos); } + +void vis_motion_type(Vis *vis, enum VisMotionType type) { + vis->action.type = type; +} diff --git a/vis.h b/vis.h @@ -110,6 +110,13 @@ enum VisMotion { void vis_motion(Vis*, enum VisMotion, ...); +enum VisMotionType { + VIS_MOTION_LINEWISE = 1 << 0, + VIS_MOTION_CHARWISE = 1 << 1, +}; + +void vis_motion_type(Vis *vis, enum VisMotionType); + enum VisTextObject { TEXT_OBJ_INNER_WORD, TEXT_OBJ_OUTER_WORD,