[Top][All Lists]

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

[elpa] externals/mct 34a5d79 2/4: Revert "Simplify mct--completions-comp

From: ELPA Syncer
Subject: [elpa] externals/mct 34a5d79 2/4: Revert "Simplify mct--completions-completion-end"
Date: Tue, 16 Nov 2021 06:59:35 -0500 (EST)

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

    Revert "Simplify mct--completions-completion-end"
    This reverts commit 790dc175c4cf869104797317c3607f7a47098e1d.
    It does not work when completion candidates contain spaces.  However, we
    still have a problem with the code we are reverting to, namely: if the
    next-completion is past a line that is fontified with
    completions-group-format then the highlight covers that whole line as
 mct.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/mct.el b/mct.el
index 3a8d927..f2a040f 100644
--- a/mct.el
+++ b/mct.el
@@ -927,9 +927,12 @@ region.")
 (defun mct--completions-completion-end ()
   "Return end of completion candidate."
-  (save-excursion
-    (goto-char (mct--completions-completion-beg))
-    (re-search-forward "\s\\|$")))
+  (if-let ((string (get-text-property (point) 'completion--string)))
+      (save-excursion
+        (next-completion 1)
+        (forward-char -1)
+        (point))
+    (point)))
 (defun mct--overlay-make ()
   "Make overlay to highlight current candidate."

reply via email to

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