PSA: don't rely on CursorHold (yet)

CursorHold (the following also applies to CursorHoldI) is an autocommand that is triggered when a user does not press a key for the time specified by updatetime. CursorHold has an extreme footgun, in that if there are any pending timers (created via timer_start()) CursorHold will not trigger at update time because there are pending events (created by timer_start), and the internals of CursorHold dictate that it not fire if there are pending events. If you are a plugin author, you should not rely on the behavior of CursorHold until this is fixed.

Sources:

:help CursorHold
:help updatetime
:help timer_start

7 Likes