From 76ba2807fbd627437332ee7b7f49bf28ec570be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 14 Jan 2016 21:21:49 +0100 Subject: [PATCH] vis: s/ops/vis_operators/g --- vis-core.h | 2 +- vis-modes.c | 4 ++-- vis-motions.c | 4 ++-- vis-operators.c | 6 +++--- vis.c | 12 ++++++------ 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/vis-core.h b/vis-core.h index b00ec9013..463b3a46a 100644 --- a/vis-core.h +++ b/vis-core.h @@ -169,7 +169,7 @@ extern Mode vis_modes[VIS_MODE_INVALID]; extern Movement moves[VIS_MOVE_INVALID]; -extern Operator ops[VIS_OP_INVALID]; +extern Operator vis_operators[VIS_OP_INVALID]; extern TextObject vis_textobjects[VIS_TEXTOBJECT_INVALID]; void action_do(Vis *vis, Action *a); diff --git a/vis-modes.c b/vis-modes.c index 7daaf05f4..64b10d042 100644 --- a/vis-modes.c +++ b/vis-modes.c @@ -95,7 +95,7 @@ static void vis_mode_insert_enter(Vis *vis, Mode *old) { macro_operator_record(vis); action_reset(&vis->action_prev); vis->action_prev.macro = vis->macro_operator; - vis->action_prev.op = &ops[VIS_OP_INSERT]; + vis->action_prev.op = &vis_operators[VIS_OP_INSERT]; } } @@ -119,7 +119,7 @@ static void vis_mode_replace_enter(Vis *vis, Mode *old) { macro_operator_record(vis); action_reset(&vis->action_prev); vis->action_prev.macro = vis->macro_operator; - vis->action_prev.op = &ops[VIS_OP_REPLACE]; + vis->action_prev.op = &vis_operators[VIS_OP_REPLACE]; } } diff --git a/vis-motions.c b/vis-motions.c index 4cd700f42..c0f7ab709 100644 --- a/vis-motions.c +++ b/vis-motions.c @@ -174,11 +174,11 @@ bool vis_motion(Vis *vis, enum VisMotion motion, ...) { switch (motion) { case VIS_MOVE_WORD_START_NEXT: - if (vis->action.op == &ops[VIS_OP_CHANGE]) + if (vis->action.op == &vis_operators[VIS_OP_CHANGE]) motion = VIS_MOVE_WORD_END_NEXT; break; case VIS_MOVE_LONGWORD_START_NEXT: - if (vis->action.op == &ops[VIS_OP_CHANGE]) + if (vis->action.op == &vis_operators[VIS_OP_CHANGE]) motion = VIS_MOVE_LONGWORD_END_NEXT; break; case VIS_MOVE_SEARCH_FORWARD: diff --git a/vis-operators.c b/vis-operators.c index 836ebed6e..11fec1c2e 100644 --- a/vis-operators.c +++ b/vis-operators.c @@ -242,9 +242,9 @@ bool vis_operator(Vis *vis, enum VisOperator id, ...) { default: break; } - if (id >= LENGTH(ops)) + if (id >= LENGTH(vis_operators)) goto err; - Operator *op = &ops[id]; + Operator *op = &vis_operators[id]; if (vis->mode->visual) { vis->action.op = op; action_do(vis, &vis->action); @@ -275,7 +275,7 @@ bool vis_operator(Vis *vis, enum VisOperator id, ...) { return false; } -Operator ops[] = { +Operator vis_operators[] = { [VIS_OP_DELETE] = { op_delete }, [VIS_OP_CHANGE] = { op_change }, [VIS_OP_YANK] = { op_yank }, diff --git a/vis.c b/vis.c index f635b0d0b..281d4b394 100644 --- a/vis.c +++ b/vis.c @@ -582,7 +582,7 @@ void action_do(Vis *vis, Action *a) { Text *txt = win->file->text; View *view = win->view; - if (a->op == &ops[VIS_OP_FILTER] && !vis->mode->visual) + if (a->op == &vis_operators[VIS_OP_FILTER] && !vis->mode->visual) vis_mode_switch(vis, VIS_MODE_VISUAL_LINE); if (a->count < 1) @@ -704,11 +704,11 @@ void action_do(Vis *vis, Action *a) { /* operator implementations must not change the mode, * they might get called multiple times (once for every cursor) */ - if (a->op == &ops[VIS_OP_INSERT] || a->op == &ops[VIS_OP_CHANGE]) { + if (a->op == &vis_operators[VIS_OP_INSERT] || a->op == &vis_operators[VIS_OP_CHANGE]) { vis_mode_switch(vis, VIS_MODE_INSERT); - } else if (a->op == &ops[VIS_OP_REPLACE]) { + } else if (a->op == &vis_operators[VIS_OP_REPLACE]) { vis_mode_switch(vis, VIS_MODE_REPLACE); - } else if (a->op == &ops[VIS_OP_FILTER]) { + } else if (a->op == &vis_operators[VIS_OP_FILTER]) { if (a->arg.s) { vis_mode_switch(vis, VIS_MODE_NORMAL); vis_cmd(vis, a->arg.s); @@ -1108,7 +1108,7 @@ void vis_repeat(Vis *vis) { vis->action_prev.count = count; count = vis->action_prev.count; /* for some operators count should be applied only to the macro not the motion */ - if (vis->action_prev.op == &ops[VIS_OP_INSERT] || vis->action_prev.op == &ops[VIS_OP_REPLACE]) + if (vis->action_prev.op == &vis_operators[VIS_OP_INSERT] || vis->action_prev.op == &vis_operators[VIS_OP_REPLACE]) vis->action_prev.count = 1; action_do(vis, &vis->action_prev); vis->action_prev.count = count; @@ -1116,7 +1116,7 @@ void vis_repeat(Vis *vis) { Mode *mode = vis->mode; Action action_prev = vis->action_prev; count = action_prev.count; - if (count < 1 || action_prev.op == &ops[VIS_OP_CHANGE] || action_prev.op == &ops[VIS_OP_FILTER]) + if (count < 1 || action_prev.op == &vis_operators[VIS_OP_CHANGE] || action_prev.op == &vis_operators[VIS_OP_FILTER]) count = 1; for (int i = 0; i < count; i++) { mode_set(vis, mode);