]> code.delx.au - gnu-emacs/commitdiff
Fix return value of vertical-motion at ZV (Bug#19553)
authorEli Zaretskii <eliz@gnu.org>
Sat, 10 Jan 2015 13:03:51 +0000 (15:03 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 10 Jan 2015 13:03:51 +0000 (15:03 +0200)
 src/indent.c (Fvertical_motion): Return zero if we started from ZV
 and there's an overlay after-string there.

src/ChangeLog
src/indent.c

index 49152c886f3a505432b2c0c2c76da55d8dea50b6..6296302dc5e62a3c31bc54b2b7b5db03e1b58ac1 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-10  Eli Zaretskii  <eliz@gnu.org>
+
+       * indent.c (Fvertical_motion): Return zero if we started from ZV
+       and there's an overlay after-string there.  (Bug#19553)
+
 2015-01-09  Eli Zaretskii  <eliz@gnu.org>
 
        * emacs.c (usage_message): Fix the description of the -nl switch.
index 8b6ecd16a674cb201e8e16be37dddf25c2ed0424..cadafcf2c301045d5086e753f4a057a8c460430b 100644 (file)
@@ -2137,10 +2137,15 @@ whether or not it is currently displayed in some window.  */)
              if (nlines > 1)
                move_it_by_lines (&it, min (PTRDIFF_MAX, nlines - 1));
            }
-         else
+         else  /* it_start = ZV */
            {
              it.vpos = 0;
              move_it_by_lines (&it, min (PTRDIFF_MAX, nlines));
+             /* We could have some display or overlay string at ZV,
+                in which case it.vpos will be nonzero now, while
+                actually we didn't move vertically at all.  */
+             if (IT_CHARPOS (it) == CHARPOS (pt) && CHARPOS (pt) == it_start)
+               it.vpos = 0;
            }
        }