loop: Simplify loop.c and move some code to input.c

- Declare poll timer in Loop structure instead of a loop_poll_events local
  variable.
- Move deferred event management to input.c
This commit is contained in:
Thiago de Arruda
2015-07-24 10:38:35 -03:00
parent ccdeb91e12
commit 3f5af6c1c4
7 changed files with 39 additions and 63 deletions

View File

@@ -63,6 +63,7 @@
#include "nvim/window.h"
#include "nvim/event/loop.h"
#include "nvim/os/time.h"
#include "nvim/os/input.h"
/*
* The Visual area is remembered for reselection.
@@ -487,9 +488,9 @@ normal_cmd (
/*
* Get the command character from the user.
*/
loop_enable_deferred_events(&loop);
input_enable_events();
c = safe_vgetc();
loop_disable_deferred_events(&loop);
input_disable_events();
if (c == K_EVENT) {
loop_process_event(&loop);