aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vis-cmds.c6
-rw-r--r--vis-core.h4
-rw-r--r--vis.c2
-rw-r--r--vis.h2
4 files changed, 7 insertions, 7 deletions
diff --git a/vis-cmds.c b/vis-cmds.c
index 7c8c314..c6a1009 100644
--- a/vis-cmds.c
+++ b/vis-cmds.c
@@ -926,7 +926,7 @@ static enum VisMode str2vismode(const char *mode) {
if (mode && modes[i] && strcmp(mode, modes[i]) == 0)
return i;
}
- return VIS_MODE_LAST;
+ return VIS_MODE_INVALID;
}
static bool cmd_map(Vis *vis, Filerange *range, enum CmdOpt opt, const char *argv[]) {
@@ -935,7 +935,7 @@ static bool cmd_map(Vis *vis, Filerange *range, enum CmdOpt opt, const char *arg
const char *lhs = argv[2];
const char *rhs = argv[3];
- if (mode == VIS_MODE_LAST || !lhs || !rhs) {
+ if (mode == VIS_MODE_INVALID || !lhs || !rhs) {
vis_info_show(vis, "usage: map mode lhs rhs\n");
return false;
}
@@ -991,7 +991,7 @@ static bool cmd_unmap(Vis *vis, Filerange *range, enum CmdOpt opt, const char *a
enum VisMode mode = str2vismode(argv[1]);
const char *lhs = argv[2];
- if (mode == VIS_MODE_LAST || !lhs) {
+ if (mode == VIS_MODE_INVALID || !lhs) {
vis_info_show(vis, "usage: unmap mode lhs rhs\n");
return false;
}
diff --git a/vis-core.h b/vis-core.h
index 069009b..b00ec90 100644
--- a/vis-core.h
+++ b/vis-core.h
@@ -120,7 +120,7 @@ struct Win {
View *view; /* currently displayed part of underlying text */
RingBuffer *jumplist; /* LRU jump management */
ChangeList changelist; /* state for iterating through least recently changes */
- Mode modes[VIS_MODE_LAST]; /* overlay mods used for per window key bindings */
+ Mode modes[VIS_MODE_INVALID]; /* overlay mods used for per window key bindings */
Win *parent; /* window which was active when showing the command prompt */
Mode *parent_mode; /* mode which was active when showing the command prompt */
Win *prev, *next; /* neighbouring windows */
@@ -165,7 +165,7 @@ 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_LAST];
+extern Mode vis_modes[VIS_MODE_INVALID];
extern Movement moves[VIS_MOVE_INVALID];
diff --git a/vis.c b/vis.c
index 4246688..232f77b 100644
--- a/vis.c
+++ b/vis.c
@@ -344,7 +344,7 @@ void vis_free(Vis *vis) {
map_free(vis->options);
map_free(vis->actions);
buffer_release(&vis->input_queue);
- for (int i = 0; i < VIS_MODE_LAST; i++)
+ for (int i = 0; i < VIS_MODE_INVALID; i++)
map_free(vis_modes[i].bindings);
free(vis);
}
diff --git a/vis.h b/vis.h
index 70575e4..9be52e0 100644
--- a/vis.h
+++ b/vis.h
@@ -117,7 +117,7 @@ enum VisMode {
VIS_MODE_VISUAL_LINE,
VIS_MODE_INSERT,
VIS_MODE_REPLACE,
- VIS_MODE_LAST,
+ VIS_MODE_INVALID,
};
void vis_mode_switch(Vis*, enum VisMode);