; (completion-preview-complete): Fix bug#76606

* lisp/completion-preview.el (completion-preview-complete):
Dismiss completion preview before calling ':exit-function'.
This eliminates potential flicker with slow exit functions
and avoids the broken preview update reported in bug#76606.
This commit is contained in:
Eshel Yaron 2025-02-27 15:34:24 +01:00
parent fa42626a6a
commit 840c682458
No known key found for this signature in database
GPG key ID: EF3EE9CA35D78618

View file

@ -520,6 +520,10 @@ completions list."
;; hook update the completion preview in case the candidate
;; can be completed further.
(when (functionp efn)
;; Remove stale preview since `efn' can make arbitrary
;; text and point modifications that might interfere with
;; a subsequent preview update. See bug#76606.
(completion-preview-active-mode -1)
(funcall efn (concat base com) (if (cdr all) 'exact 'finished)))
;; Otherwise, remove the common prefix from the preview.
(completion-preview--inhibit-update)