From a1881512f3050e8d6719a28b55846c1f4c93acab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Fri, 13 May 2016 23:13:52 +0200 Subject: vis: clean up key mapping implementation --- vis.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'vis.h') diff --git a/vis.h b/vis.h index b751063..ab7eade 100644 --- a/vis.h +++ b/vis.h @@ -132,10 +132,11 @@ enum VisMode { }; void vis_mode_switch(Vis*, enum VisMode); -/* in the specified mode: map a given key to a binding (binding->key is ignored), - * fails if key is already mapped */ -bool vis_mode_map(Vis*, enum VisMode, const char *key, const KeyBinding*); -bool vis_window_mode_map(Win*, enum VisMode, const char *key, const KeyBinding*); +/* In the specified mode: map a given key to a binding (binding->key is ignored). + * Fails if a prefix of `key' is already mapped and `force' is false. Otherwise + * all such prefixes are unmapped. */ +bool vis_mode_map(Vis*, enum VisMode, bool force, const char *key, const KeyBinding*); +bool vis_window_mode_map(Win*, enum VisMode, bool force, const char *key, const KeyBinding*); /* in the specified mode: unmap a given key, fails if the key is not currently mapped */ bool vis_mode_unmap(Vis*, enum VisMode, const char *key); bool vis_window_mode_unmap(Win*, enum VisMode, const char *key); -- cgit v1.2.3