Skip to content

Commit

Permalink
vis: remove unused struct Mode member 'is_user'
Browse files Browse the repository at this point in the history
  • Loading branch information
martanne committed Jan 27, 2016
1 parent b9e8d20 commit edb2213
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
1 change: 0 additions & 1 deletion vis-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ struct Mode {
const char *name; /* descriptive, user facing name of the mode */
const char *status; /* name displayed in the window status bar */
const char *help; /* short description used by :help */
bool isuser; /* whether this is a user or internal mode */
void (*enter)(Vis*, Mode *old); /* called right before the mode becomes active */
void (*leave)(Vis*, Mode *new); /* called right before the mode becomes inactive */
void (*input)(Vis*, const char*, size_t); /* called whenever a key is not found in this mode and all its parent modes */
Expand Down
8 changes: 1 addition & 7 deletions vis-modes.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void mode_set(Vis *vis, Mode *new_mode) {
return;
if (vis->mode->leave)
vis->mode->leave(vis, new_mode);
if (vis->mode->isuser)
if (vis->mode != &vis_modes[VIS_MODE_OPERATOR_PENDING])
vis->mode_prev = vis->mode;
vis->mode = new_mode;
if (new_mode->enter)
Expand Down Expand Up @@ -143,19 +143,16 @@ Mode vis_modes[] = {
.name = "OPERATOR-PENDING",
.input = vis_mode_operator_input,
.help = "",
.isuser = false,
},
[VIS_MODE_NORMAL] = {
.name = "NORMAL",
.status = "",
.help = "",
.isuser = true,
},
[VIS_MODE_VISUAL] = {
.name = "VISUAL",
.status = "--VISUAL--",
.help = "",
.isuser = true,
.enter = vis_mode_visual_enter,
.leave = vis_mode_visual_leave,
.visual = true,
Expand All @@ -164,7 +161,6 @@ Mode vis_modes[] = {
.name = "VISUAL LINE",
.status = "--VISUAL LINE--",
.help = "",
.isuser = true,
.enter = vis_mode_visual_line_enter,
.leave = vis_mode_visual_line_leave,
.visual = true,
Expand All @@ -173,7 +169,6 @@ Mode vis_modes[] = {
.name = "INSERT",
.status = "--INSERT--",
.help = "",
.isuser = true,
.enter = vis_mode_insert_enter,
.leave = vis_mode_insert_leave,
.input = vis_mode_insert_input,
Expand All @@ -184,7 +179,6 @@ Mode vis_modes[] = {
.name = "REPLACE",
.status = "--REPLACE--",
.help = "",
.isuser = true,
.enter = vis_mode_replace_enter,
.leave = vis_mode_replace_leave,
.input = vis_mode_replace_input,
Expand Down

0 comments on commit edb2213

Please sign in to comment.