aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-11-28 16:18:53 +0100
committerMarc André Tanner <mat@brain-dump.org>2015-11-28 20:09:14 +0100
commitde9fa14094e1a97769af014d4c23aabfab145d87 (patch)
tree0d19cc46456d993f86d4bf2a59a3f2810b055d89 /main.c
parentb09c2afba792282de34ed8865fd2a4ca53a48d9d (diff)
downloadvis-de9fa14094e1a97769af014d4c23aabfab145d87.tar.gz
vis-de9fa14094e1a97769af014d4c23aabfab145d87.tar.xz
vis: add cmd argument to VIS_OP_FILTER
Diffstat (limited to 'main.c')
-rw-r--r--main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/main.c b/main.c
index 35d2f41..70216df 100644
--- a/main.c
+++ b/main.c
@@ -62,6 +62,8 @@ static const char *gotoline(Vis*, const char *keys, const Arg *arg);
static const char *motiontype(Vis*, const char *keys, const Arg *arg);
/* make the current action use the operator indicated by arg->i */
static const char *operator(Vis*, const char *keys, const Arg *arg);
+/* use arg->s as command for the filter operator */
+static const char *operator_filter(Vis*, const char *keys, const Arg *arg);
/* blocks to read a key and performs movement indicated by arg->i which
* should be one of VIS_MOVE_{RIGHT,LEFT}_{TO,TILL} */
static const char *movement_key(Vis*, const char *keys, const Arg *arg);
@@ -708,7 +710,7 @@ static KeyAction vis_action[] = {
[VIS_ACTION_OPERATOR_FILTER] = {
"vis-operator-filter",
"Filter operator",
- operator, { .i = VIS_OP_FILTER }
+ operator_filter,
},
[VIS_ACTION_COUNT] = {
"vis-count",
@@ -1256,6 +1258,11 @@ static const char *operator(Vis *vis, const char *keys, const Arg *arg) {
return keys;
}
+static const char *operator_filter(Vis *vis, const char *keys, const Arg *arg) {
+ vis_operator(vis, VIS_OP_FILTER, arg->s);
+ return keys;
+}
+
static const char *movement_key(Vis *vis, const char *keys, const Arg *arg) {
if (!keys[0])
return NULL;