aboutsummaryrefslogtreecommitdiffstats
path: root/src/help.c
diff options
context:
space:
mode:
authorLars Henriksen <LarsHenriksen@get2net.dk>2020-12-27 23:30:48 +0100
committerLukas Fleischer <lfleischer@calcurse.org>2021-04-11 19:46:11 -0400
commit338c640a19013152c90776494b3adf29a69de4a3 (patch)
treeded6fb08d644a1c251ba3fedbd38c1b897773ee2 /src/help.c
parent6e6663c5dde69fe4928790fd44ed46c70e31215f (diff)
downloadcalcurse-338c640a19013152c90776494b3adf29a69de4a3.tar.gz
calcurse-338c640a19013152c90776494b3adf29a69de4a3.zip
Allow undefined actions in keys configuration file
In the keys file there are three possibilities for each action: 1. One or several keys are assigned to it 2. It is marked as UNDEFINED (new) 3. It is missing from the file On load of the keys file, calcurse respectively 1. Assigns the key(s) 2. Assigns "UNDEFINED" (new) 3. Assigns a default key if possible If default keys were assigned, the user is informed of the number of actions affected, and the keys file is updated. After load each action must either have keys assigned or be undefined. If not, calcurse exits with a failure. If there are syntax/semantic errors in the file, calcurse rejects the file and exits. When an interactive user leaves the keys configuration menu, a warning is issued if any action is UNDEFINED. The keys file is always updated. Addresses GitHub issue #298. Additionally: Description of concepts and data structures used for keyboard keys and virtual keys (actions) as well as name changes and comments to improve readability. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/help.c')
-rw-r--r--src/help.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/help.c b/src/help.c
index 398fb6d..40a03b8 100644
--- a/src/help.c
+++ b/src/help.c
@@ -105,7 +105,7 @@ int display_help(const char *topic)
if (!io_file_exists(path)) {
int ch = keys_str2int(topic);
- enum key action = keys_get_action(ch);
+ enum vkey action = keys_get_action(ch);
if (ch > 0 && action > 0 && action != KEY_UNDEF) {
topic = keys_get_label(action);
mem_free(path);