mirror of
https://github.com/neovim/neovim.git
synced 2025-11-25 11:40:40 +00:00
event loop: New abstraction layer with refactored time/signal API
- Add event loop abstraction module under src/nvim/event. The src/nvim/event/loop module replaces src/nvim/os/event - Remove direct dependency on libuv signal/timer API and use the new abstraction instead. - Replace all references to uv_default_loop() by &loop.uv, a new global variable that wraps libuv main event loop but allows the event loop functions to be reused in other contexts.
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
#include "nvim/terminal.h"
|
||||
#include "nvim/undo.h"
|
||||
#include "nvim/window.h"
|
||||
#include "nvim/os/event.h"
|
||||
#include "nvim/event/loop.h"
|
||||
#include "nvim/os/input.h"
|
||||
#include "nvim/os/time.h"
|
||||
|
||||
@@ -601,15 +601,15 @@ edit (
|
||||
* Get a character for Insert mode. Ignore K_IGNORE.
|
||||
*/
|
||||
lastc = c; /* remember previous char for CTRL-D */
|
||||
event_enable_deferred();
|
||||
loop_enable_deferred_events(&loop);
|
||||
do {
|
||||
c = safe_vgetc();
|
||||
} while (c == K_IGNORE);
|
||||
event_disable_deferred();
|
||||
loop_disable_deferred_events(&loop);
|
||||
|
||||
if (c == K_EVENT) {
|
||||
c = lastc;
|
||||
event_process();
|
||||
loop_process_event(&loop);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user