]> git.neil.brown.name Git - edlib.git/commitdiff
lib-input - don't assume Efallthrough is 0
authorNeilBrown <neil@brown.name>
Wed, 9 Aug 2023 00:56:23 +0000 (10:56 +1000)
committerNeilBrown <neil@brown.name>
Fri, 11 Aug 2023 04:36:36 +0000 (14:36 +1000)
One day I might change Efallthrough..

Signed-off-by: NeilBrown <neil@brown.name>
DOC/TODO.md
lib-input.c

index a3e1a6a0161ac12c5dbd51760ade82e57ee6f50a..ff63fda269808a222410658c2bde59c094223d7c 100644 (file)
@@ -11,7 +11,7 @@ the file.
 
 - [ ] find a better wat to handle "case when EOF is at the end" of
       a non-empty line.
-- [ ] input uses 0 for Efallthrough!
+- [X] input uses 0 for Efallthrough!
 - [X] call, not caLl in server.py
 - [X] lib-server received unexpected notification Close
 - [ ] should pane ->cx,cy be a struct xy??
index 69e6a7ebda10dc32676f1b498969d6ff65c067c7..7cf9455385a4f956b916ca062609bf3cf162b7e9 100644 (file)
@@ -216,12 +216,12 @@ DEF_CMD(keystroke)
        key = strconcat(ci->home, "K", mode, ci->str);
        time_starts(ci->home);
        ret = call(key, p, num, m, NULL, num2);
-       if (ret == 0 && (alt = map_key(ci->str)) != NULL) {
+       if (ret == Efallthrough && (alt = map_key(ci->str)) != NULL) {
                key = strconcat(ci->home, "K", mode, alt);
                ret = call(key, p, num, m, NULL, num2);
        }
        time_ends(ci->home);
-       if (ret < 0)
+       if (ret <= Efail)
                call("Message:default", ci->focus, 0, NULL,
                     "** Command Failed **");
        return Efallthrough;