diff --git a/elisp/corfu-terminal-popupinfo.el b/elisp/corfu-terminal-popupinfo.el index f6afbf6..7ebfd43 100644 --- a/elisp/corfu-terminal-popupinfo.el +++ b/elisp/corfu-terminal-popupinfo.el @@ -87,7 +87,9 @@ As this is :around advice, OLDFUN is the real (advised) function to call." (goto-char (point-min)) (put-text-property (point-min) (point-max) 'face 'corfu-popupinfo) (when-let ((m (memq 'corfu-default (alist-get 'default face-remapping-alist)))) - (setcar m 'corfu-popupinfo))))) + (setcar m 'corfu-popupinfo))) + ;; We succeeded in loading the data + t)) (defun ctp--popon-position (buffer) "Find a good position to open the popon for BUFFER's content. @@ -201,10 +203,12 @@ CANDIDATE is the same as for `corfu-popupinfo--show'. As this is meant to be (not (corfu--equal-including-properties candidate corfu-popupinfo--candidate))) (let ((buf (ctp--get-buffer))) - (ctp--load-content candidate buf) - (ctp--display-buffer buf)) - (setq corfu-popupinfo--candidate candidate - corfu-popupinfo--toggle t)))) + (if (ctp--load-content candidate buf) + (progn + (ctp--display-buffer buf) + (setq corfu-popupinfo--candidate candidate + corfu-popupinfo--toggle t)) + (corfu-popupinfo--hide)))))) (defun ctp--move-away-from-eob () "Ensure the point isn't too close to the end of the buffer."