]> git.neil.brown.name Git - edlib.git/commitdiff
Drop the on_idle- multicall.
authorNeilBrown <neil@brown.name>
Fri, 9 Jun 2023 03:25:15 +0000 (13:25 +1000)
committerNeilBrown <neil@brown.name>
Wed, 28 Jun 2023 07:51:40 +0000 (17:51 +1000)
event:on-idle is doing all on-idle stuff, so we don't need the on_idle-
multicall any more.

Signed-off-by: NeilBrown <neil@brown.name>
DOC/Developer/04-events.md
DOC/TODO.md
edlib.c

index 637e64f7500d6ca181c0fab92642be7800d9e978..5a681fd736e7ecc2c3d274f6008d0e2f1a17284f 100644 (file)
@@ -9,12 +9,9 @@ messages that themselves register other handlers for various events.
 When these events occurs the relevant handlers are called, and so begins
 the chain of messages that results in anything happening in the editor.
 
-FIXME this isn't quite right at present.
-The event subsystems isn't quite the ultimate starting point.  The
-editor must have a main loop with sends the message "event:run" to the
-root pane, and then runs "pane_refresh()" on that pane.  The "event:run"
-handler, registered by the event subsystem, determines what events have
-happening, if any, and calls the relevant handlers.
+The event subsystem handles all events.  After any initialisation it is
+sufficient to call it repeatedly with the "event:run" message while it
+returns 1.
 
 The messages that the event subsystem listens for are:
 
index 308d7c275cfae5fec09abcadd0a446a07219aa15..f579992710615702393fdbde65bb110aa497360e 100644 (file)
@@ -40,7 +40,7 @@ the file.
 
 ### Medium
 
-- [ ] add event:on-idle with 3 priority levels
+- [X] add event:on-idle with 3 priority levels
 - [X] Always do word-count async.
 - [X] lib-url
 - [ ] lib-mergeview improvements
@@ -82,7 +82,7 @@ Core features
 - [ ] give every pane a link to root/editor main and use that
       instead of statics.  Then maybe times_up() can use pane_too_long()
 - [ ] mark DEF_CMD structs as const
-- [ ] add event:on-idle with 3 priority levels
+- [X] add event:on-idle with 3 priority levels
       2 - fast cleanup that must be run immediately
       1 - slower general response to recent command: typically
           pane_refresh
diff --git a/edlib.c b/edlib.c
index c75d6eb42305858519de11bae753a2f10614b854..b98aa01d8f3cb974140a92e113938c6504c9efac 100644 (file)
--- a/edlib.c
+++ b/edlib.c
@@ -177,11 +177,8 @@ int main(int argc, char *argv[])
 
        if (first_window) {
                call("global-multicall-startup-", first_window);
-               while (call("event:run", ed) == 1) {
-                       time_start(TIME_IDLE);
-                       call("global-multicall-on_idle-", ed);
-                       time_stop(TIME_IDLE);
-               }
+               while (call("event:run", ed) == 1)
+                       ;
        } else
                fprintf(stderr, "edlib: cannot create a display\n");
        pane_close(ed);