From edb2213b0efbd2fcfa2656a3e29cb2ce20b90d93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 27 Jan 2016 17:38:15 +0100 Subject: [PATCH] vis: remove unused struct Mode member 'is_user' --- vis-core.h | 1 - vis-modes.c | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/vis-core.h b/vis-core.h index b65039e93..9010ea43f 100644 --- a/vis-core.h +++ b/vis-core.h @@ -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 */ diff --git a/vis-modes.c b/vis-modes.c index 8b9966340..d7784e218 100644 --- a/vis-modes.c +++ b/vis-modes.c @@ -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) @@ -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, @@ -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, @@ -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, @@ -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,