[vim/vim] completion: 'autocompletedelay' deferral leaks state and mistimes the popup (after 9.2.0739) (PR #20669)

1 view
Skip to first unread message

h_east

unread,
5:39 AM (8 hours ago) 5:39 AM
to vim/vim, Subscribed
Problem:  After 'autocompletedelay' was made non-blocking, the deferred
          popup can misbehave: a pending autocomplete survives leaving
          Insert mode and then keeps waking the editor in Normal mode,
          the deferral is recorded into registers while recording a
          macro, the popup appears an extra 'updatetime' late when
          'autocompletedelay' is larger and a CursorHoldI autocommand
          exists, CursorHoldI can fire twice without an intervening
          keypress, and an open balloon is dismissed.
Solution: Treat the deferral like CursorHold: only keep it pending in
          Insert mode and not while recording, with pending typeahead,
          or when completion is already active; drop it when Insert mode
          ends; measure the delay from when the user typed so a
          CursorHold in between does not push the popup back; and do not
          let the deferral re-enable CursorHoldI or dismiss the balloon.

related #20598

This PR implements the audit's recommended fix A and B, and additionally
addresses findings 4 (popup timing) and 5 (CursorHoldI) which the audit had
left for a maintainer decision. See the audit for details:
#20666 (comment)

Note: this PR does not include the changes from #20666. Those fix separate
regressions from the same patch (i_CTRL-G_U and i_CTRL-K) and are not covered
here, so #20666 still needs to be merged separately


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20669

Commit Summary

  • 9e33d8e completion: 'autocompletedelay' deferral leaks state and mistimes the popup (after 9.2.0739)

File Changes

(6 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20669@github.com>

Reply all
Reply to author
Forward
0 new messages