aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-02-24 09:17:04 +0100
committerMarc André Tanner <mat@brain-dump.org>2017-02-24 09:55:32 +0100
commit30b32b7d9f5ddb34abfc57663553e5b0ca3f4f83 (patch)
tree7a135cba78eda985a4cd6bb2e98c0c2286b35f0a
parentf2090b4b13c13711e6e1b9d3a7cde2cf5f121efe (diff)
downloadvis-30b32b7d9f5ddb34abfc57663553e5b0ca3f4f83.tar.gz
vis-30b32b7d9f5ddb34abfc57663553e5b0ca3f4f83.tar.xz
vis: remove unused struct member
The macro replay code has since been refactored, making this obsolete. There is only ever one input queue from which keys are interpreted.
-rw-r--r--vis-core.h1
-rw-r--r--vis.c7
2 files changed, 3 insertions, 5 deletions
diff --git a/vis-core.h b/vis-core.h
index a67fd69..4350794 100644
--- a/vis-core.h
+++ b/vis-core.h
@@ -183,7 +183,6 @@ struct Vis {
char key_current[VIS_KEY_LENGTH_MAX];/* current key being processed by the input queue */
char key_prev[VIS_KEY_LENGTH_MAX]; /* previous key which was processed by the input queue */
Buffer input_queue; /* holds pending input keys */
- Buffer *keys; /* currently active keys buffer (either the input_queue or a macro) */
bool errorhandler; /* whether we are currently in an error handler, used to avoid recursion */
Action action; /* current action which is in progress */
Action action_prev; /* last operator action used by the repeat (dot) command */
diff --git a/vis.c b/vis.c
index 8dfb38a..78714c8 100644
--- a/vis.c
+++ b/vis.c
@@ -541,7 +541,6 @@ Vis *vis_new(Ui *ui, VisEvent *event) {
array_init(&vis->actions_user);
action_reset(&vis->action);
buffer_init(&vis->input_queue);
- vis->keys = &vis->input_queue;
if (!(vis->command_file = file_new_internal(vis, NULL)))
goto err;
if (!(vis->search_file = file_new_internal(vis, NULL)))
@@ -980,7 +979,7 @@ bool vis_keys_utf8(Vis *vis, const char *keys, char utf8[static UTFmax+1]) {
}
static void vis_keys_process(Vis *vis, size_t pos) {
- Buffer *buf = vis->keys;
+ Buffer *buf = &vis->input_queue;
char *keys = buf->data + pos, *start = keys, *cur = keys, *end = keys, *binding_end = keys;;
bool prefix = false;
KeyBinding *binding = NULL;
@@ -1093,7 +1092,7 @@ static void vis_keys_push(Vis *vis, const char *input, size_t pos, bool record)
macro_append(vis->recording, input);
if (vis->macro_operator)
macro_append(vis->macro_operator, input);
- if (buffer_append0(vis->keys, input))
+ if (buffer_append0(&vis->input_queue, input))
vis_keys_process(vis, pos);
}
@@ -1288,7 +1287,7 @@ static void macro_replay(Vis *vis, const Macro *macro) {
}
static void macro_replay_internal(Vis *vis, const Macro *macro) {
- size_t pos = buffer_length0(vis->keys);
+ size_t pos = buffer_length0(&vis->input_queue);
for (char *key = macro->data, *next; key; key = next) {
char tmp;
next = (char*)vis_keys_next(vis, key);