aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-03-19 14:05:32 +0100
committerMarc André Tanner <mat@brain-dump.org>2017-03-19 14:58:07 +0100
commit5166e81e794c0faa80742ad6806745b13b967a51 (patch)
treed2f4cd3ece83311bbea9ea172ea12d8337225fa2 /vis.c
parent5fb583f035bb8e699e8980e63050ef1f41f94dd9 (diff)
downloadvis-5166e81e794c0faa80742ad6806745b13b967a51.tar.gz
vis-5166e81e794c0faa80742ad6806745b13b967a51.tar.xz
vis: add infrastructure for user specified operators
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/vis.c b/vis.c
index 4c93872..06546ab 100644
--- a/vis.c
+++ b/vis.c
@@ -676,6 +676,7 @@ Vis *vis_new(Ui *ui, VisEvent *event) {
vis->change_colors = true;
vis->registers[VIS_REG_BLACKHOLE].type = REGISTER_BLACKHOLE;
vis->registers[VIS_REG_CLIPBOARD].type = REGISTER_CLIPBOARD;
+ array_init(&vis->operators);
array_init(&vis->motions);
array_init(&vis->textobjects);
array_init(&vis->bindings);
@@ -745,6 +746,7 @@ void vis_free(Vis *vis) {
buffer_release(&vis->input_queue);
for (int i = 0; i < VIS_MODE_INVALID; i++)
map_free(vis_modes[i].bindings);
+ array_release_full(&vis->operators);
array_release_full(&vis->motions);
array_release_full(&vis->textobjects);
while (array_length(&vis->bindings))
@@ -852,6 +854,7 @@ void vis_do(Vis *vis) {
.reg = reg,
.linewise = linewise,
.arg = &a->arg,
+ .context = a->op ? a->op->context : NULL,
};
bool err = false;