diff options
Diffstat (limited to 'vis-motions.c')
| -rw-r--r-- | vis-motions.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vis-motions.c b/vis-motions.c index a9c354c..1e9d9c5 100644 --- a/vis-motions.c +++ b/vis-motions.c @@ -221,6 +221,12 @@ static size_t percent(Vis *vis, Text *txt, size_t pos) { return text_size(txt) * ratio / 100; } +static size_t byte(Vis *vis, Text *txt, size_t pos) { + pos = vis_count_get_default(vis, 0); + size_t max = text_size(txt); + return pos <= max ? pos : max; +} + void vis_motion_type(Vis *vis, enum VisMotionType type) { vis->action.type = type; } @@ -577,4 +583,8 @@ const Movement vis_motions[] = { .vis = percent, .type = IDEMPOTENT, }, + [VIS_MOVE_BYTE] = { + .vis = byte, + .type = IDEMPOTENT, + }, }; |
