conf: bindings: allow several mappings for the same action

If the bindings has different pipe command associated with them, treat
them as different actions.
This commit is contained in:
Daniel Eklöf 2020-07-15 16:39:07 +02:00
parent 062b0eb7ab
commit 1541531765
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 166 additions and 87 deletions

View file

@ -6,6 +6,7 @@
#include <tllist.h>
#include "terminal.h"
#include "wayland.h"
struct config_font {
char *pattern;
@ -13,6 +14,17 @@ struct config_font {
int px_size;
};
struct config_key_binding_normal {
enum bind_action_normal action;
char *key;
char *pipe_cmd;
};
struct config_key_binding_search {
enum bind_action_search action;
char *key;
};
struct config {
char *term;
char *shell;
@ -48,10 +60,8 @@ struct config {
struct {
/* Bindings for "normal" mode */
char *key[BIND_ACTION_COUNT];
char *spawn[BIND_ACTION_COUNT];
struct mouse_binding mouse[BIND_ACTION_COUNT];
tll(struct config_key_binding_normal) key;
tll(struct mouse_binding) mouse;
/*
* Special modes
@ -59,7 +69,7 @@ struct config {
/* While searching (not - action to *start* a search is in the
* 'key' bindings above */
char *search[BIND_ACTION_SEARCH_COUNT];
tll(struct config_key_binding_search) search;
} bindings;
struct {