aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/event.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-10-20 08:44:46 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-10-21 11:05:49 -0300
commit77cc078c41c4348a3649cc366a262e6fab43980b (patch)
tree80e6df8ed06db3388beeff54f27e2c1beef511cd /src/nvim/os/event.c
parentcf6f60ce4dc376570e8d71facea76299ca951604 (diff)
downloadrneovim-77cc078c41c4348a3649cc366a262e6fab43980b.tar.gz
rneovim-77cc078c41c4348a3649cc366a262e6fab43980b.tar.bz2
rneovim-77cc078c41c4348a3649cc366a262e6fab43980b.zip
event: Remove EventType enum and pass a callback to `event_push`
This approach is more flexible because we don't need to support a fixed set of "event types", any module can push events to be handled in main loop by simply passing a callback to the Event structure.
Diffstat (limited to 'src/nvim/os/event.c')
-rw-r--r--src/nvim/os/event.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/nvim/os/event.c b/src/nvim/os/event.c
index f20d43c6a4..43c02b13b2 100644
--- a/src/nvim/os/event.c
+++ b/src/nvim/os/event.c
@@ -170,19 +170,7 @@ static size_t process_from(klist_t(Event) *queue)
Event event;
while (kl_shift(Event, queue, &event) == 0) {
- switch (event.type) {
- case kEventSignal:
- signal_handle(event);
- break;
- case kEventRStreamData:
- rstream_read_event(event);
- break;
- case kEventJobExit:
- job_exit_event(event);
- break;
- default:
- abort();
- }
+ event.handler(event);
count++;
}