aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-01-14 21:21:49 +0100
committerMarc André Tanner <mat@brain-dump.org>2016-01-14 21:21:49 +0100
commit76ba2807fbd627437332ee7b7f49bf28ec570be9 (patch)
tree11df56fe7e6838afa30d503ab594727aea73ed92
parent6890bdee214b13ed3916375b4871022a010423ec (diff)
downloadvis-76ba2807fbd627437332ee7b7f49bf28ec570be9.tar.gz
vis-76ba2807fbd627437332ee7b7f49bf28ec570be9.tar.xz
vis: s/ops/vis_operators/g
-rw-r--r--vis-core.h2
-rw-r--r--vis-modes.c4
-rw-r--r--vis-motions.c4
-rw-r--r--vis-operators.c6
-rw-r--r--vis.c12
5 files changed, 14 insertions, 14 deletions
diff --git a/vis-core.h b/vis-core.h
index b00ec90..463b3a4 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 7daaf05..64b10d0 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 4cd700f..c0f7ab7 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 836ebed..11fec1c 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 @@ err:
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 f635b0d..281d4b3 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);