aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-10-28 10:14:23 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-10-29 07:47:48 -0300
commit7dae3ad24ddd4d36e6ebb6d873e285d06130da46 (patch)
tree9668bb40cf32bc5a36d2568d8bd2f3ba24eb9241
parent98b5ec565b955687ad7e2914378d999975b841df (diff)
downloadrneovim-7dae3ad24ddd4d36e6ebb6d873e285d06130da46.tar.gz
rneovim-7dae3ad24ddd4d36e6ebb6d873e285d06130da46.tar.bz2
rneovim-7dae3ad24ddd4d36e6ebb6d873e285d06130da46.zip
os/input.c: Fix assertion in `create_cursorhold_event`
The assertion now considers the case where events are disabled.
-rw-r--r--src/nvim/os/input.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c
index df803609ae..ef6b5ff6f5 100644
--- a/src/nvim/os/input.c
+++ b/src/nvim/os/input.c
@@ -82,9 +82,11 @@ static void cursorhold_event(void **argv)
static void create_cursorhold_event(void)
{
- // If the queue had any items, this function should not have been
- // called(inbuf_poll would return kInputAvail)
- assert(queue_empty(loop.events));
+ // If events are enabled and the queue has any items, this function should not
+ // have been called(inbuf_poll would return kInputAvail)
+ // TODO(tarruda): Cursorhold should be implemented as a timer set during the
+ // `state_check` callback for the states where it can be triggered.
+ assert(!events_enabled || queue_empty(loop.events));
queue_put(loop.events, cursorhold_event, 0);
}