diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2015-08-07 22:54:02 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2015-08-13 08:49:38 -0300 |
commit | 502aee690c980fcb3cfcb3f211dcfad06103db46 (patch) | |
tree | 803dbcccaa874b78cbdfeacc74b7cc891e09f89a /src/nvim/ui.c | |
parent | a6e0d35d2da3ee4270ddb712410ea0c8c55b0f0f (diff) | |
download | rneovim-502aee690c980fcb3cfcb3f211dcfad06103db46.tar.gz rneovim-502aee690c980fcb3cfcb3f211dcfad06103db46.tar.bz2 rneovim-502aee690c980fcb3cfcb3f211dcfad06103db46.zip |
event: Refactor async event processing
- Improve the implementation of deferred/immediate events.
- Use the new queue module to change how/when events are queued/processed by
giving a private queue to each emitter.
- Immediate events(which only exist to break uv_run recursion) are now
represented in the `loop->fast_events` queue.
- Events pushed to child queues are propagated to the event loop main queue and
processed as K_EVENT keys.
Diffstat (limited to 'src/nvim/ui.c')
-rw-r--r-- | src/nvim/ui.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 7e155f9b4f..ad875367c9 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -214,9 +214,9 @@ void ui_detach(UI *ui) shift_index++; } - ui_count--; - // schedule a refresh - loop_push_event(&loop, (Event) { .handler = refresh }, false); + if (--ui_count) { + ui_refresh(); + } } void ui_clear(void) @@ -485,11 +485,3 @@ static void ui_mode_change(void) UI_CALL(mode_change, mode); conceal_check_cursur_line(); } - -static void refresh(Event event) -{ - if (ui_count) { - ui_refresh(); - } -} - |