diff src/window.c @ 90106:bf0d492ea2d5

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-16 Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-106 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-110 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-111 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-112 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-113 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-114 <no summary provided> * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-115 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-123 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-124 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-17 - miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-19 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-20 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-21 More work on moving images to etc/images * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-22 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-23 Fix errors with image-file installation * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-24 etc/Makefile.in (install): Put gnus-tut.txt in the right place. * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-25 etc/Makefile.in (install, uninstall): Fix installed image dirs. * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-26 etc/Makefile.in (install): Create $(etcdir)/images/gnus dir. * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-27 Update from CVS
author Miles Bader <miles@gnu.org>
date Wed, 23 Feb 2005 09:18:23 +0000
parents befae6bafecb d75e10df3675
children 146c086df160
line wrap: on
line diff
--- a/src/window.c	Fri Feb 18 00:41:50 2005 +0000
+++ b/src/window.c	Wed Feb 23 09:18:23 2005 +0000
@@ -4763,6 +4763,7 @@
   else if (n < 0)
     {
       int charpos, bytepos;
+      int partial_p;
 
       /* Save our position, for the preserve_y case.  */
       charpos = IT_CHARPOS (it);
@@ -4774,7 +4775,20 @@
 		  it.last_visible_y - this_scroll_margin - 1, -1,
 		  MOVE_TO_POS | MOVE_TO_Y);
 
-      if (IT_CHARPOS (it) == PT)
+      /* Save our position, in case it's correct.  */
+      charpos = IT_CHARPOS (it);
+      bytepos = IT_BYTEPOS (it);
+
+      /* See if point is on a partially visible line at the end.  */
+      if (it.what == IT_EOB)
+	partial_p = it.current_y + it.ascent + it.descent > it.last_visible_y;
+      else
+	{
+	  move_it_by_lines (&it, 1, 1);
+	  partial_p = it.current_y > it.last_visible_y;
+	}
+
+      if (charpos == PT && !partial_p)
 	/* We found PT before we found the display margin, so PT is ok.  */
 	;
       else if (preserve_y >= 0)
@@ -4795,14 +4809,7 @@
 	}
       else
 	{
-	  /* Save our position, in case it's correct.  */
-	  charpos = IT_CHARPOS (it);
-	  bytepos = IT_BYTEPOS (it);
-
-	  /* See if point is on a partially visible line at the end.  */
-	  move_it_by_lines (&it, 1, 1);
-
-	  if (it.current_y > it.last_visible_y)
+	  if (partial_p)
 	    /* The last line was only partially visible, so back up two
 	       lines to make sure we're on a fully visible line.  */
 	    {