emacs-diffs
[Top][All Lists]
Advanced

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

master 4c5043c: * lisp/simple.el (previous-line-or-history-element): Han


From: Juri Linkov
Subject: master 4c5043c: * lisp/simple.el (previous-line-or-history-element): Handle logical lines.
Date: Thu, 20 Aug 2020 19:21:43 -0400 (EDT)

branch: master
commit 4c5043c50b52e404c211c18da8cd59a2ee86253d
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * lisp/simple.el (previous-line-or-history-element): Handle logical lines.
    
    When 'line-move-visual' is nil, use 'end-of-line' to move point to the end
    of the first logical line (bug#42862)
    
    Thanks to Michael Welsh Duggan <mwd@md5i.com>.
---
 lisp/simple.el | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index f080153..b106d4b 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2416,15 +2416,17 @@ previous element of the minibuffer history in the 
minibuffer."
                                    (goto-char (1- (minibuffer-prompt-end)))
                                    (current-column))))
             (move-to-column old-column))
-        ;; Put the cursor at the end of the visual line instead of the
-        ;; logical line, so the next `previous-line-or-history-element'
-        ;; would move to the previous history element, not to a possible upper
-        ;; visual line from the end of logical line in `line-move-visual' mode.
-        (end-of-visual-line)
-        ;; Since `end-of-visual-line' puts the cursor at the beginning
-        ;; of the next visual line, move it one char back to the end
-        ;; of the first visual line (bug#22544).
-        (unless (eolp) (backward-char 1)))))))
+        (if (not line-move-visual) ; Handle logical lines (bug#42862)
+            (end-of-line)
+          ;; Put the cursor at the end of the visual line instead of the
+          ;; logical line, so the next `previous-line-or-history-element'
+          ;; would move to the previous history element, not to a possible 
upper
+          ;; visual line from the end of logical line in `line-move-visual' 
mode.
+          (end-of-visual-line)
+          ;; Since `end-of-visual-line' puts the cursor at the beginning
+          ;; of the next visual line, move it one char back to the end
+          ;; of the first visual line (bug#22544).
+          (unless (eolp) (backward-char 1))))))))
 
 (defun next-complete-history-element (n)
   "Get next history element that completes the minibuffer before the point.



reply via email to

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