vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 3a730f69b1b794a210690e070f9a9cf2b8e636f0
parent d899e718a69a593f55a7b0b0ef69fecd03abfa32
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Thu, 14 Jan 2016 21:24:19 +0100

vis: s/moves/vis_motions/g

Diffstat:
Mvis-core.h | 5+----
Mvis-motions.c | 4++--
Mvis.c | 2+-
3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/vis-core.h b/vis-core.h @@ -164,11 +164,8 @@ struct Vis { /** stuff used by multiple of the vis-* files */ -/* TODO: make part of Vis struct? enable dynamic modes? */ extern Mode vis_modes[VIS_MODE_INVALID]; - -extern Movement moves[VIS_MOVE_INVALID]; - +extern Movement vis_motions[VIS_MOVE_INVALID]; extern Operator vis_operators[VIS_OP_INVALID]; extern TextObject vis_textobjects[VIS_TEXTOBJECT_INVALID]; diff --git a/vis-motions.c b/vis-motions.c @@ -245,7 +245,7 @@ bool vis_motion(Vis *vis, enum VisMotion motion, ...) { break; } - vis->action.movement = &moves[motion]; + vis->action.movement = &vis_motions[motion]; va_end(ap); action_do(vis, &vis->action); return true; @@ -254,7 +254,7 @@ err: return false; } -Movement moves[] = { +Movement vis_motions[] = { [VIS_MOVE_LINE_UP] = { .cur = view_line_up, .type = LINEWISE }, [VIS_MOVE_LINE_DOWN] = { .cur = view_line_down, .type = LINEWISE }, [VIS_MOVE_SCREEN_LINE_UP] = { .cur = view_screenline_up, }, diff --git a/vis.c b/vis.c @@ -699,7 +699,7 @@ void action_do(Vis *vis, Action *a) { if (a->op) { /* we do not support visual repeat, still do something resonable */ if (vis->mode->visual && !a->movement && !a->textobj) - a->movement = &moves[VIS_MOVE_NOP]; + a->movement = &vis_motions[VIS_MOVE_NOP]; /* operator implementations must not change the mode, * they might get called multiple times (once for every cursor)