Skip to content

Commit

Permalink
vis: s/ops/vis_operators/g
Browse files Browse the repository at this point in the history
  • Loading branch information
martanne committed Jan 14, 2016
1 parent 6890bde commit 76ba280
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion vis-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions vis-modes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}

Expand All @@ -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];
}
}

Expand Down
4 changes: 2 additions & 2 deletions vis-motions.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions vis-operators.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 },
Expand Down
12 changes: 6 additions & 6 deletions vis.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -1108,15 +1108,15 @@ 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;
if (macro) {
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);
Expand Down

0 comments on commit 76ba280

Please sign in to comment.