; * lisp/completion-preview.el: Fix race condition.

* lisp/completion-preview.el (completion-preview--update):
Bind 'inhibit-quit' to non-nil around completion preview
overlay initialization.  This binding prevents the
surrounding 'while-no-input' from interrupting the overlay
initialization, which yields an inconsistent state wherein
the overlay is visible but completion-preview-active-mode
wasn't enabled.
This commit is contained in:
Eshel Yaron 2025-08-13 21:48:18 +02:00
parent 7856dd557a
commit 9351fad650
No known key found for this signature in database
GPG key ID: EF3EE9CA35D78618

View file

@ -521,7 +521,9 @@ candidates or if there are multiple matching completions and
(run-hook-wrapped
'completion-at-point-functions
#'completion-preview--capf-wrapper)
(when-let* ((suffix (car suffixes)))
(when-let* ((suffix (car suffixes))
(inhibit-quit t))
;; Critical section, do not quit upon receiving input here.
(set-text-properties 0 (length suffix)
(list 'face (if (cdr suffixes)
'completion-preview