From: NeilBrown Date: Wed, 9 Aug 2023 00:56:23 +0000 (+1000) Subject: lib-input - don't assume Efallthrough is 0 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=ac64008306690e68dd172c4e2d58d3045c40427f;p=edlib.git lib-input - don't assume Efallthrough is 0 One day I might change Efallthrough.. Signed-off-by: NeilBrown --- diff --git a/DOC/TODO.md b/DOC/TODO.md index a3e1a6a0..ff63fda2 100644 --- a/DOC/TODO.md +++ b/DOC/TODO.md @@ -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?? diff --git a/lib-input.c b/lib-input.c index 69e6a7eb..7cf94553 100644 --- a/lib-input.c +++ b/lib-input.c @@ -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;