]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug #15712 with vertical motion when the goal column needs to hscroll.
authorEli Zaretskii <eliz@gnu.org>
Fri, 25 Oct 2013 09:45:51 +0000 (12:45 +0300)
committerEli Zaretskii <eliz@gnu.org>
Fri, 25 Oct 2013 09:45:51 +0000 (12:45 +0300)
 lisp/simple.el (line-move): Call line-move-1 instead of
 line-move-visual when the current window hscroll is zero, but
 temporary-goal-column indicates we will need to hscroll as result
 of the movement.

lisp/ChangeLog
lisp/simple.el

index 07de60c735d59c4d38be269bb2058e746e3abe9e..c7da1c86416a5f64ad9b3b77c69bf81b17a2d8db 100644 (file)
@@ -1,3 +1,10 @@
+2013-10-25  Eli Zaretskii  <eliz@gnu.org>
+
+       * simple.el (line-move): Call line-move-1 instead of
+       line-move-visual when the current window hscroll is zero, but
+       temporary-goal-column indicates we will need to hscroll as result
+       of the movement.  (Bug#15712)
+
 2013-10-25  Dmitry Gutov  <dgutov@yandex.ru>
 
        * progmodes/ruby-mode.el (ruby-mode-menu): Use proper
index 3fefce15d2a7d43a1c641ff83c590924405882aa..1f1b5cb376fa5effebc7d274bb9d73963c803c47 100644 (file)
@@ -4908,7 +4908,16 @@ The value is a floating-point number."
               ;; When the text in the window is scrolled to the left,
               ;; display-based motion doesn't make sense (because each
               ;; logical line occupies exactly one screen line).
-              (not (> (window-hscroll) 0)))
+              (not (> (window-hscroll) 0))
+              ;; Likewise when the text _was_ scrolled to the left
+              ;; when the current run of vertical motion commands
+              ;; started.
+              (not (and (memq last-command
+                              `(next-line previous-line ,this-command))
+                        auto-hscroll-mode
+                        (numberp temporary-goal-column)
+                        (>= temporary-goal-column
+                           (- (window-width) hscroll-margin)))))
          (prog1 (line-move-visual arg noerror)
            ;; If we moved into a tall line, set vscroll to make
            ;; scrolling through tall images more smooth.