[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu f5b6c5d 6/6: Renamings
From: |
Protesilaos Stavrou |
Subject: |
[elpa] externals/corfu f5b6c5d 6/6: Renamings |
Date: |
Thu, 29 Apr 2021 06:51:19 -0400 (EDT) |
branch: externals/corfu
commit f5b6c5df1cd17b587225a0ccee12d6bf3dd30841
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Renamings
---
corfu.el | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/corfu.el b/corfu.el
index 51ab8f2..33ffa3b 100644
--- a/corfu.el
+++ b/corfu.el
@@ -231,7 +231,7 @@ Set to nil in order to disable confirmation."
(set-frame-size corfu--frame width height t)
(make-frame-visible corfu--frame)))
-(defun corfu--popup (pos lines &optional curr lo bar)
+(defun corfu--popup-show (pos lines &optional curr lo bar)
"Show LINES as popup at POS, with CURR highlighted and scrollbar from LO to
LO+BAR."
(let* ((cw (frame-char-width))
(ch (frame-char-height))
@@ -262,6 +262,14 @@ Set to nil in order to disable confirmation."
str))
lines "\n"))))
+(defun corfu--popup-hide ()
+ "Hide Corfu popup."
+ (when (frame-live-p corfu--frame)
+ (make-frame-invisible corfu--frame)
+ (with-current-buffer (window-buffer (frame-root-window corfu--frame))
+ (erase-buffer)))
+ (remove-hook 'window-configuration-change-hook #'corfu--popup-hide))
+
(defun corfu--move-to-front (elem list)
"Move ELEM to front of LIST."
(if-let (found (member elem list))
@@ -417,7 +425,7 @@ Set to nil in order to disable confirmation."
(setq lo (max 1 lo)))
(when (/= last corfu--total)
(setq lo (min (- corfu-count bar 2) lo)))
- (corfu--popup (+ beg corfu--base) ann-cands curr (and (> corfu--total
corfu-count) lo) bar)))
+ (corfu--popup-show (+ beg corfu--base) ann-cands curr (and (> corfu--total
corfu-count) lo) bar)))
(defun corfu--update ()
"Refresh Corfu UI."
@@ -454,26 +462,18 @@ Set to nil in order to disable confirmation."
nil)
((and (not corfu--candidates) ;; 4) There are no
candidates
corfu-no-match) ;; & Confirmation is
enabled
- (corfu--popup beg (list corfu-no-match)) ;; => Show confirmation
popup
+ (corfu--popup-show beg (list corfu-no-match)) ;; => Show confirmation
popup
t))))
(defun corfu--pre-command-hook ()
"Insert selected candidate unless keep alive command."
- (add-hook 'window-configuration-change-hook #'corfu--hide)
+ (add-hook 'window-configuration-change-hook #'corfu--popup-hide)
(unless (or (< corfu--index 0) (corfu--keep-alive-p))
(corfu--insert 'exact)))
-(defun corfu--hide ()
- "Hide Corfu popup."
- (when (frame-live-p corfu--frame)
- (make-frame-invisible corfu--frame)
- (with-current-buffer (window-buffer (frame-root-window corfu--frame))
- (erase-buffer)))
- (remove-hook 'window-configuration-change-hook #'corfu--hide))
-
(defun corfu--post-command-hook ()
"Refresh Corfu after last command."
- (remove-hook 'window-configuration-change-hook #'corfu--hide)
+ (remove-hook 'window-configuration-change-hook #'corfu--popup-hide)
(or (pcase completion-in-region--data
(`(,beg ,end ,_table ,_pred)
(when (and (eq (marker-buffer beg) (current-buffer)) (<= beg (point)
end))
@@ -627,7 +627,7 @@ Set to nil in order to disable confirmation."
(defun corfu--teardown ()
"Teardown Corfu."
- (corfu--hide)
+ (corfu--popup-hide)
(remove-hook 'pre-command-hook #'corfu--pre-command-hook 'local)
(remove-hook 'post-command-hook #'corfu--post-command-hook 'local)
(when corfu--overlay (delete-overlay corfu--overlay))
- [elpa] externals/corfu updated (e8180e0 -> f5b6c5d), Protesilaos Stavrou, 2021/04/29
- [elpa] externals/corfu e39ac1f 4/6: Call corfu-abort, Protesilaos Stavrou, 2021/04/29
- [elpa] externals/corfu 36f51ad 2/6: Simplify state management, Protesilaos Stavrou, 2021/04/29
- [elpa] externals/corfu a605fc3 5/6: Delete overlay before update, Protesilaos Stavrou, 2021/04/29
- [elpa] externals/corfu 51bab59 1/6: More robust window configuration change handling, Protesilaos Stavrou, 2021/04/29
- [elpa] externals/corfu 1763cb9 3/6: Revert "Simplify state management", Protesilaos Stavrou, 2021/04/29
- [elpa] externals/corfu f5b6c5d 6/6: Renamings,
Protesilaos Stavrou <=