From 998d5cf3fa03b231d0207117e7a5e07ce527a938 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Tue, 5 Nov 2024 08:50:06 -0800 Subject: [PATCH] Fix error handling in crofu-terminal-popupinfo.el --- elisp/corfu-terminal-popupinfo.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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."