aboutsummaryrefslogtreecommitdiff
path: root/vis-cmds.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-04-14 21:36:19 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-04-14 21:36:19 +0200
commitbd1d849b2033b04a372542c59d458d4f8279c937 (patch)
tree4485bb3b20436d76ad59fd5b9ea9d75f792aa17c /vis-cmds.c
parentd7c917ea63e0374fc03622d4f21df8ac4c574fae (diff)
downloadvis-bd1d849b2033b04a372542c59d458d4f8279c937.tar.gz
vis-bd1d849b2033b04a372542c59d458d4f8279c937.tar.xz
vis: allow mapping of <Space>
One should generally use <Space> in mappings: :map! normal <Space> h except for insert/replace mode where a literal space has to be used: :map! insert " " foo
Diffstat (limited to 'vis-cmds.c')
-rw-r--r--vis-cmds.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/vis-cmds.c b/vis-cmds.c
index 0ef6139..e58d20a 100644
--- a/vis-cmds.c
+++ b/vis-cmds.c
@@ -471,16 +471,15 @@ static bool cmd_earlier_later(Vis *vis, Win *win, Command *cmd, const char *argv
}
static bool print_keylayout(const char *key, void *value, void *data) {
- return text_appendf(data, " %-15s\t%s\n", key, (char*)value);
+ return text_appendf(data, " %-18s\t%s\n", key[0] == ' ' ? "␣" : key, (char*)value);
}
static bool print_keybinding(const char *key, void *value, void *data) {
- Text *txt = data;
KeyBinding *binding = value;
const char *desc = binding->alias;
if (!desc && binding->action)
desc = binding->action->help;
- return text_appendf(txt, " %-15s\t%s\n", key[0] == ' ' ? "<Space>" : key, desc ? desc : "");
+ return text_appendf(data, " %-18s\t%s\n", key[0] == ' ' ? "␣" : key, desc ? desc : "");
}
static void print_mode(Mode *mode, Text *txt) {
@@ -507,7 +506,7 @@ static bool cmd_help(Vis *vis, Win *win, Command *cmd, const char *argv[], Curso
for (int i = 0; i < LENGTH(vis_modes); i++) {
Mode *mode = &vis_modes[i];
if (mode->help)
- text_appendf(txt, " %-15s\t%s\n", mode->name, mode->help);
+ text_appendf(txt, " %-18s\t%s\n", mode->name, mode->help);
}