mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
os/input.c: Fix assertion in create_cursorhold_event
The assertion now considers the case where events are disabled.
This commit is contained in:
parent
98b5ec565b
commit
7dae3ad24d
@ -82,9 +82,11 @@ static void cursorhold_event(void **argv)
|
|||||||
|
|
||||||
static void create_cursorhold_event(void)
|
static void create_cursorhold_event(void)
|
||||||
{
|
{
|
||||||
// If the queue had any items, this function should not have been
|
// If events are enabled and the queue has any items, this function should not
|
||||||
// called(inbuf_poll would return kInputAvail)
|
// have been called(inbuf_poll would return kInputAvail)
|
||||||
assert(queue_empty(loop.events));
|
// 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);
|
queue_put(loop.events, cursorhold_event, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user