emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r113442: Fix bug #14881 with scrolling images smalle


From: Eli Zaretskii
Subject: [Emacs-diffs] trunk r113442: Fix bug #14881 with scrolling images smaller than the window height.
Date: Wed, 17 Jul 2013 16:48:24 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113442
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/14881
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Wed 2013-07-17 19:47:49 +0300
message:
  Fix bug #14881 with scrolling images smaller than the window height.
  
   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.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/simple.el                 simple.el-20091113204419-o5vbwnq5f7feedwu-403
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-07-16 19:16:51 +0000
+++ b/lisp/ChangeLog    2013-07-17 16:47:49 +0000
@@ -1,3 +1,9 @@
+2013-07-17  Eli Zaretskii  <address@hidden>
+
+       * 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  <address@hidden>
 
        * progmodes/ruby-mode.el (ruby-font-lock-keywords): Do not

=== modified file 'lisp/simple.el'
--- a/lisp/simple.el    2013-07-15 00:49:22 +0000
+++ b/lisp/simple.el    2013-07-17 16:47:49 +0000
@@ -4800,6 +4800,8 @@
           (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 @@
          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 @@
               (> 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 @@
          ;; 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 @@
            ;; 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))))


reply via email to

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