diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2013-07-17 01:21:20 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2013-07-17 14:03:53 +0200 |
commit | 0d053e2b2b3f1381f5492ff21ee7ed27613eac0b (patch) | |
tree | c9467211edd4ed93833c459474ca5943b8866cca /src/calcurse.c | |
parent | 20709b7a7e1bdaae59d704596898e727e1155d77 (diff) | |
download | calcurse-0d053e2b2b3f1381f5492ff21ee7ed27613eac0b.zip |
Allow for getting help on key bindings
In addition to getting help on specific topics, users can type things
like ":help s" or ":help ^A" to get help on specific key bindings now.
Note that we do not add help texts for these keys here -- we will alias
key bindings to already existing topics in a follow-up patch.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/calcurse.c')
-rw-r--r-- | src/calcurse.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/calcurse.c b/src/calcurse.c index c3a7ce8..9127c98 100644 --- a/src/calcurse.c +++ b/src/calcurse.c @@ -506,6 +506,14 @@ static inline void key_generic_cmd(void) topic = "intro"; snprintf(path, BUFSIZ, DOCDIR "/%s.txt", topic); + + if (!io_file_exist(path) && keys_str2int(topic) > 0 && + keys_get_action(keys_str2int(topic)) > 0) { + enum key action = keys_get_action(keys_str2int(topic)); + snprintf(path, BUFSIZ, DOCDIR "/%s.txt", + keys_get_label(action)); + } + if (io_file_exist(path)) { wins_launch_external(path, conf.pager); } else { |