neovim/neovim — pull request #1316 by tarruda (2014-10-20 23:36:36+00:00)
Title: [RDY] Refactor deferral

The commits contain detailed explanation of what this PR does, but in a few words: It fixes a bug that block the implementation of UI via msgpack-rpc(reported some time ago by @equalsraf in #914 and more recently by @junegunn in junegunn/vim-plug#103). It is also the first part of a planned improvement to the event/libuv integration(It removes the ugly hack for focusing on event sources, now all events are processed immediately)

The behavior still persists for JobActivity commands, that is, `K_EVENT` keys are still pushed and they affect pending operators. Unfortunately the only solution to the problem is to patch every operator function to handle K_EVENT correctly(due to the way normal.c/ops.c/getchar.c are currently organized, it's not possible to use a generic solution)