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>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user