Skip to content

vim.wait(math.huge) fails on some systems #36854

@phanen

Description

@phanen

Problem

when write a nvim -l scripts, to wait for all events I use vim.wait() in a loop.
but vim.wait(0) will use 100% of a cpu core. Can we remove this condition to make vim.wait(-1) wait forever?

if (timeout < 0) {
return luaL_error(lstate, "timeout must be >= 0");
}

/// < 0: wait forever.

so while true do vim.wait(0) end can be used as -> vim.wait(-1).

Expected behavior

vim.wait(-1) wait forever.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions