diff options
author | Eli Zaretskii <eliz@gnu.org> | 2013-10-25 12:45:51 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2013-10-25 12:45:51 +0300 |
commit | fbfd0e1d751dd142064b9aaebbf71818d99ae5f1 (patch) | |
tree | 251be92fb13f2d00e7c6bbfdb519cb109d5c35d3 /lisp/simple.el | |
parent | 6702c559da3fa6b5a94c42039c9f93d7b2b1fe83 (diff) | |
download | emacs-fbfd0e1d751dd142064b9aaebbf71818d99ae5f1.tar.gz emacs-fbfd0e1d751dd142064b9aaebbf71818d99ae5f1.tar.bz2 emacs-fbfd0e1d751dd142064b9aaebbf71818d99ae5f1.zip |
Fix bug #15712 with vertical motion when the goal column needs to hscroll.
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.
Diffstat (limited to 'lisp/simple.el')
-rw-r--r-- | lisp/simple.el | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 3fefce15d2a..1f1b5cb376f 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -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. |