-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Labels
Milestone
Description
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?
neovim/src/nvim/lua/executor.c
Lines 455 to 457 in e42050f
| if (timeout < 0) { | |
| return luaL_error(lstate, "timeout must be >= 0"); | |
| } |
Line 76 in 442f297
| /// < 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.
Reactions are currently unavailable