[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu-doc 7997122f70 67/95: Fix error that resize doc p
From: |
ELPA Syncer |
Subject: |
[elpa] externals/corfu-doc 7997122f70 67/95: Fix error that resize doc popup when refreshing |
Date: |
Tue, 19 Jul 2022 15:58:06 -0400 (EDT) |
branch: externals/corfu-doc
commit 7997122f70aecc83e36af9d533613b3c05d85f0e
Author: Yuwei Tian <ibluefocus@outlook.com>
Commit: Yuwei Tian <ibluefocus@outlook.com>
Fix error that resize doc popup when refreshing
---
corfu-doc.el | 52 ++++++++++++++++++++++++++++------------------------
1 file changed, 28 insertions(+), 24 deletions(-)
diff --git a/corfu-doc.el b/corfu-doc.el
index eed0bbbaaa..ef5a7212ab 100644
--- a/corfu-doc.el
+++ b/corfu-doc.el
@@ -380,13 +380,15 @@ FWIDTH and FHEIGHT."
(defun corfu-doc--refresh-popup ()
"Update the position of the doc popup when corfu popup edges changed."
- (make-frame-visible corfu-doc--frame)
- (apply #'corfu-doc--set-frame-position
- corfu-doc--frame
- (corfu-doc--calculate-doc-frame-position
- (frame-pixel-width corfu-doc--frame)
- (frame-pixel-height corfu-doc--frame)))
- (setq corfu-doc--cf-popup-edges (corfu-doc--get-cf-popup-edges)))
+ (unless (corfu-doc--popup-visible-p)
+ (make-frame-visible corfu-doc--frame))
+ (when (corfu-doc--cf-popup-edges-changed-p)
+ (apply #'corfu--set-frame-position
+ corfu-doc--frame
+ (corfu-doc--calculate-doc-frame-position
+ (frame-pixel-width corfu-doc--frame)
+ (frame-pixel-height corfu-doc--frame)))
+ (setq corfu-doc--cf-popup-edges (corfu-doc--get-cf-popup-edges))))
(defun corfu-doc--update-popup (doc)
(corfu-doc--make-frame doc)
@@ -395,7 +397,8 @@ FWIDTH and FHEIGHT."
(corfu-doc--calculate-doc-frame-position)))
(defun corfu-doc--cf-popup-visible-p ()
- (frame-visible-p corfu--frame))
+ (and (frame-live-p corfu--frame)
+ (frame-visible-p corfu--frame)))
(defun corfu-doc--should-show-popup (&optional candidate-index)
(and (and (fboundp 'corfu-mode) corfu-mode)
@@ -463,17 +466,16 @@ FWIDTH and FHEIGHT."
(defun corfu-doc--cf-popup-edges-changed-p ()
(not (equal (corfu-doc--get-cf-popup-edges) corfu-doc--cf-popup-edges)))
-(defun corfu-doc--popup-transit (candidate)
- (unless (corfu-doc--should-refresh-popup candidate)
- (when (corfu-doc--popup-visible-p)
- (if (and corfu-doc-mode corfu-doc-auto (> corfu-doc-delay 0))
- (if (> corfu-doc-delay corfu-doc-hide-threshold)
- (corfu-doc--make-popup-invisible)
- ;; clear buffer and update popup position immediately
- (corfu-doc--clear-buffer)
- (when (corfu-doc--cf-popup-edges-changed-p)
- (corfu-doc--refresh-popup)))
- (corfu-doc--popup-hide)))))
+(defun corfu-doc--popup-transit ()
+ (when (corfu-doc--popup-visible-p)
+ (if (and corfu-doc-mode corfu-doc-auto (> corfu-doc-delay 0))
+ (if (> corfu-doc-delay corfu-doc-hide-threshold)
+ (corfu-doc--make-popup-invisible)
+ ;; clear buffer and update popup position immediately
+ (corfu-doc--clear-buffer)
+ (when (corfu-doc--cf-popup-edges-changed-p)
+ (corfu-doc--refresh-popup)))
+ (corfu-doc--popup-hide))))
(defun corfu-doc--popup-show (&rest _args)
(when corfu-doc--auto-timer
@@ -482,11 +484,13 @@ FWIDTH and FHEIGHT."
(when (corfu-doc--popup-support-p)
(if-let ((candidate (corfu-doc--get-candidate)))
(progn
- (corfu-doc--popup-transit candidate)
- (when (and corfu-doc-mode corfu-doc-auto)
- (setq corfu-doc--auto-timer
- (run-with-timer corfu-doc-delay nil
- #'corfu-doc--manual-popup-show corfu--index))))
+ (if (corfu-doc--should-refresh-popup candidate)
+ (corfu-doc--refresh-popup)
+ (corfu-doc--popup-transit)
+ (when (and corfu-doc-mode corfu-doc-auto)
+ (setq corfu-doc--auto-timer
+ (run-with-timer corfu-doc-delay nil
+ #'corfu-doc--manual-popup-show corfu--index)))))
(corfu-doc--popup-hide))))
(defun corfu-doc--funcall (function &rest args)
- [elpa] externals/corfu-doc 904df4f99a 62/95: Make corfu-doc-mode a global minor mode, (continued)
- [elpa] externals/corfu-doc 904df4f99a 62/95: Make corfu-doc-mode a global minor mode, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 9750d1af61 65/95: Fix calling corfu-doc--refresh-popup, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 9d81c522f6 56/95: Simplify code, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc f63395100e 69/95: Fix typo (#14), ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 96b5de8cce 61/95: Version 0.5.1, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 611895ef47 66/95: Version 0.6.0, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 7b10759a2e 73/95: Fix warnings, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 8170be8375 77/95: Fix duplicate code, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc d89012ed6a 68/95: Version 0.6.1, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc cc13a259dd 86/95: No need to check corfu-mode, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 7997122f70 67/95: Fix error that resize doc popup when refreshing,
ELPA Syncer <=
- [elpa] externals/corfu-doc aadf628d98 79/95: Remove redundant :group args, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 733739d090 78/95: Add and adjust docstrings, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc caccd94757 88/95: Inline the function to get coordinates of the corfu popup, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 5dd2a2987a 94/95: Don't display warning when child frame is not supported (#17, #19), ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 78032cf8e2 91/95: Revert "Inline the function to get coordinates of the corfu popup", ELPA Syncer, 2022/07/19