emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/corfu-doc 214b14115e 39/95: Hide doc frame if there is


From: ELPA Syncer
Subject: [elpa] externals/corfu-doc 214b14115e 39/95: Hide doc frame if there is no documentation
Date: Tue, 19 Jul 2022 15:58:03 -0400 (EDT)

branch: externals/corfu-doc
commit 214b14115e7464a01ea22e513a52af6783a32e42
Author: Yuwei Tian <ibluefocus@outlook.com>
Commit: Yuwei Tian <ibluefocus@outlook.com>

    Hide doc frame if there is no documentation
---
 corfu-doc.el | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/corfu-doc.el b/corfu-doc.el
index d6cbd2f9e5..4c83919588 100644
--- a/corfu-doc.el
+++ b/corfu-doc.el
@@ -331,16 +331,18 @@ FWIDTH and FHEIGHT."
                      (corfu-doc--calculate-doc-frame-position))
               (setq corfu-doc--cf-frame-edges cf-frame-edges)))
         ;; fetch documentation and show
-        (when-let* ((res (ignore-errors (corfu-doc-fetch-documentation)))
-                    (doc (unless (string-empty-p (string-trim res)) res)))
-          (corfu-doc--make-frame doc)
-          (apply #'corfu-doc--set-frame-position
-                 corfu-doc--frame
-                 (corfu-doc--calculate-doc-frame-position))
-          (setq corfu-doc--candidate candidate)
-          (setq corfu-doc--cf-frame-edges cf-frame-edges)))
-      (corfu--echo-refresh)
-      (setq corfu-doc--window (selected-window)))))
+        (if-let* ((res (ignore-errors (corfu-doc-fetch-documentation)))
+                  (doc (unless (string-empty-p (string-trim res)) res)))
+            (progn
+              (corfu-doc--make-frame doc)
+              (apply #'corfu-doc--set-frame-position
+                     corfu-doc--frame
+                     (corfu-doc--calculate-doc-frame-position))
+              (setq corfu-doc--candidate candidate)
+              (setq corfu-doc--cf-frame-edges cf-frame-edges)
+              (corfu--echo-refresh)
+              (setq corfu-doc--window (selected-window)))
+          (corfu-doc-hide))))))
 
 (defun corfu-doc-manually ()
   (interactive)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]