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

@@ -601,11 +601,11 @@ edit (
* Get a character for Insert mode. Ignore K_IGNORE.
*/
lastc = c; /* remember previous char for CTRL-D */
loop_enable_deferred_events(&loop);
input_enable_events();
do {
c = safe_vgetc();
} while (c == K_IGNORE);
loop_disable_deferred_events(&loop);
input_disable_events();
if (c == K_EVENT) {
c = lastc;