[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/mct f22a96a0ff 1/2: Try to fix regression with hidden t
From: |
ELPA Syncer |
Subject: |
[elpa] externals/mct f22a96a0ff 1/2: Try to fix regression with hidden top candidate |
Date: |
Wed, 29 Dec 2021 07:04:07 -0500 (EST) |
branch: externals/mct
commit f22a96a0ff91286e6aa1f1f9ae596c9431828ae0
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Try to fix regression with hidden top candidate
See issue 15: <https://gitlab.com/protesilaos/mct/-/issues/15>.
I think it is now fixed, though we must also check with Emacs 27.
---
mct.el | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/mct.el b/mct.el
index 925ddeb54d..869bac4613 100644
--- a/mct.el
+++ b/mct.el
@@ -220,16 +220,17 @@ See `completions-format' for possible values."
(defun mct--setup-clean-completions ()
"Keep only completion candidates in the Completions."
(with-current-buffer standard-output
- (let ((inhibit-read-only t))
- (goto-char (point-min))
- (delete-region (point-at-bol) (1+ (point-at-eol)))
- (insert (propertize " "
- 'cursor-sensor-functions
- (list
- (lambda (_win prev dir)
- (when (eq dir 'entered)
- (goto-char prev))))))
- (put-text-property (point-min) (point) 'invisible t))))
+ (goto-char (mct--first-completion-point))
+ (unless (mct--completions-completion-p)
+ (let ((inhibit-read-only t))
+ (delete-region (point-at-bol) (1+ (point-at-eol)))
+ (insert (propertize " "
+ 'cursor-sensor-functions
+ (list
+ (lambda (_win prev dir)
+ (when (eq dir 'entered)
+ (goto-char prev))))))
+ (put-text-property (point-min) (point) 'invisible t)))))
(defun mct--fit-completions-window (&rest _args)
"Fit Completions' buffer to its window."