]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug #14881 with scrolling images smaller than the window height.
authorEli Zaretskii <eliz@gnu.org>
Wed, 17 Jul 2013 16:47:49 +0000 (19:47 +0300)
committerEli Zaretskii <eliz@gnu.org>
Wed, 17 Jul 2013 16:47:49 +0000 (19:47 +0300)
 lisp/simple.el (line-move-partial, line-move): Don't start vscroll or
 scroll-up if the current line is not taller than the window.

lisp/ChangeLog
lisp/simple.el

index b88f66f98d0d3117b083c0ef1329494a852759c8..25fd3e6171e4d95aa97d2381ba875c687e092369 100644 (file)
@@ -1,3 +1,9 @@
+2013-07-17  Eli Zaretskii  <eliz@gnu.org>
+
+       * simple.el (line-move-partial, line-move): Don't start vscroll or
+       scroll-up if the current line is not taller than the window.
+       (Bug#14881)
+
 2013-07-16  Dmitry Gutov  <dgutov@yandex.ru>
 
        * progmodes/ruby-mode.el (ruby-font-lock-keywords): Do not
index bcce938df733aae8700b6b843f0fdbe4eee7aeda..4b158d31f36acc646a2e251c2f595a27534664e0 100644 (file)
@@ -4800,6 +4800,8 @@ The value is a floating-point number."
           (this-ypos (nth 2 this-lh))
           (dlh (default-line-height))
           (wslines (window-screen-lines))
+          (edges (window-inside-pixel-edges))
+          (winh (- (nth 3 edges) (nth 1 edges) 1))
           py vs last-line)
       (if (> (mod wslines 1.0) 0.0)
          (setq wslines (round (+ wslines 0.5))))
@@ -4848,7 +4850,7 @@ The value is a floating-point number."
          nil)
         ;; If cursor is not in the bottom scroll margin, and the
         ;; current line is is not too tall, move forward.
-        ((and (or (null this-height) (<= this-height dlh))
+        ((and (or (null this-height) (<= this-height winh))
               vpos
               (> vpos 0)
               (< py last-line))
@@ -4865,7 +4867,7 @@ The value is a floating-point number."
               (> vpos 0)
               (= py last-line))
          ;; Don't vscroll if the partially-visible line at window
-         ;; bottom has the default height (a.k.a. "just one more text
+         ;; bottom is not too tall (a.k.a. "just one more text
          ;; line"): in that case, we do want redisplay to behave
          ;; normally, i.e. recenter or whatever.
          ;;
@@ -4874,7 +4876,7 @@ The value is a floating-point number."
          ;; partially-visible glyph row at the end of the window.  As
          ;; we are dealing with floats, we disregard sub-pixel
          ;; discrepancies between that and DLH.
-         (if (and rowh rbot (>= (- (+ rowh rbot) dlh) 1))
+         (if (and rowh rbot (>= (- (+ rowh rbot) winh) 1))
              (set-window-vscroll nil dlh t))
          (line-move-1 arg noerror to-end)
          t)
@@ -4918,10 +4920,13 @@ The value is a floating-point number."
            ;; If we moved into a tall line, set vscroll to make
            ;; scrolling through tall images more smooth.
            (let ((lh (line-pixel-height))
-                 (dlh (default-line-height)))
+                 (edges (window-inside-pixel-edges))
+                 (dlh (default-line-height))
+                 winh)
+             (setq winh (- (nth 3 edges) (nth 1 edges) 1))
              (if (and (< arg 0)
                       (< (point) (window-start))
-                      (> lh dlh))
+                      (> lh winh))
                  (set-window-vscroll
                   nil
                   (- lh dlh) t))))