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

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

[elpa] externals/mct 31cc039 4/4: Fix vertical re-positioning


From: ELPA Syncer
Subject: [elpa] externals/mct 31cc039 4/4: Fix vertical re-positioning
Date: Tue, 16 Nov 2021 04:57:24 -0500 (EST)

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

    Fix vertical re-positioning
    
    Before we were tracking the current column so that when a vertical
    motion would be performed we would move point back to that column.  The
    idea is to make motions in a grid view intuitive.  However, the
    Completions' buffer uses tabs to align candidates, so this approach
    would fail to move to the candidate above/below if point would land in a
    tabbed space.  What it would do instead is move vertically and then
    shift to the next completion after point.  Whereas now if it lands in a
    tab, it goes to the candidate before point.
    
    This is an older bug, but we repurpose the code from d3aa0ca to take
    care of it.
---
 mct.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mct.el b/mct.el
index 5bb9714..4bd2ab2 100644
--- a/mct.el
+++ b/mct.el
@@ -564,7 +564,8 @@ minibuffer."
           (vertical-motion (or arg 1))
           (unless (eq col (save-excursion (goto-char (point-at-bol)) 
(current-column)))
             (line-move-to-column col))
-          (unless (get-text-property (point) 'completion--string)
+          (when (or (> (current-column) col)
+                    (not (get-text-property (point) 'completion--string)))
             (next-completion -1)))
       (next-completion (or arg 1))))
    (setq this-command 'next-line)))
@@ -600,7 +601,8 @@ minibuffer."
           (vertical-motion (or (- arg) -1))
           (unless (eq col (save-excursion (goto-char (point-at-bol)) 
(current-column)))
             (line-move-to-column col))
-          (unless (get-text-property (point) 'completion--string)
+          (when (or (> (current-column) col)
+                    (not (get-text-property (point) 'completion--string)))
             (next-completion -1)))
       (previous-completion (if (natnump arg) arg 1))))))
 



reply via email to

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