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

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

[elpa] externals/mct 3f90353233 53/64: Make mct--setup-clean-completions


From: ELPA Syncer
Subject: [elpa] externals/mct 3f90353233 53/64: Make mct--setup-clean-completions more robust
Date: Thu, 30 Dec 2021 23:58:01 -0500 (EST)

branch: externals/mct
commit 3f903532332c0a033b1e68e25b47778e444022ab
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Make mct--setup-clean-completions more robust
---
 mct.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/mct.el b/mct.el
index c415cd981a..5956366f7f 100644
--- a/mct.el
+++ b/mct.el
@@ -210,6 +210,11 @@ See `completions-format' for possible values."
              mct-show-completion-line-numbers)
     (display-line-numbers-mode 1)))
 
+(defun mct--first-line-completion-p ()
+  "Return non-nil if first line contains completion candidates."
+  (eq (line-number-at-pos (point-min))
+      (line-number-at-pos (mct--first-completion-point))))
+
 ;; Thanks to Omar AntolĂ­n Camarena for recommending the use of
 ;; `cursor-sensor-functions' and the concomitant hook with
 ;; `cursor-censor-mode' instead of the dirty hacks I had before to
@@ -220,8 +225,8 @@ See `completions-format' for possible values."
 (defun mct--setup-clean-completions ()
   "Keep only completion candidates in the Completions."
   (with-current-buffer standard-output
-    (goto-char (point-min))
-    (unless (mct--completions-completion-p)
+    (unless (mct--first-line-completion-p)
+      (goto-char (point-min))
       (let ((inhibit-read-only t))
         (delete-region (point-at-bol) (1+ (point-at-eol)))
         (insert (propertize " "



reply via email to

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