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

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

[elpa] externals/mct d3aa0ca 3/4: Make vertical motions keep point on co


From: ELPA Syncer
Subject: [elpa] externals/mct d3aa0ca 3/4: Make vertical motions keep point on completions
Date: Tue, 16 Nov 2021 04:57:24 -0500 (EST)

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

    Make vertical motions keep point on completions
    
    Before if the point was at the end of the line over a long completion
    candidate and a down/up motion was performed, it could move outside the
    boundaries of the completion if that was shorter than the one above it.
---
 mct.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/mct.el b/mct.el
index 020f5a9..5bb9714 100644
--- a/mct.el
+++ b/mct.el
@@ -563,7 +563,9 @@ minibuffer."
               (setq arg 2)))
           (vertical-motion (or arg 1))
           (unless (eq col (save-excursion (goto-char (point-at-bol)) 
(current-column)))
-            (line-move-to-column col)))
+            (line-move-to-column col))
+          (unless (get-text-property (point) 'completion--string)
+            (next-completion -1)))
       (next-completion (or arg 1))))
    (setq this-command 'next-line)))
 
@@ -597,7 +599,9 @@ minibuffer."
               (setq arg 2)))
           (vertical-motion (or (- arg) -1))
           (unless (eq col (save-excursion (goto-char (point-at-bol)) 
(current-column)))
-            (line-move-to-column col)))
+            (line-move-to-column col))
+          (unless (get-text-property (point) 'completion--string)
+            (next-completion -1)))
       (previous-completion (if (natnump arg) arg 1))))))
 
 (declare-function text-property-search-backward "text-property-search" 
(property &optional value predicate not-current))



reply via email to

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