aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorMiles Bader <[email protected]>2005-02-23 09:18:23 +0000
committerMiles Bader <[email protected]>2005-02-23 09:18:23 +0000
commit1ff56495788f79262ed64540eebb81083e571369 (patch)
tree32203951504b9857186ee711b64b1eb87bfa19af /src/window.c
parent8d46efcc0f2045a1e5a2739c55ba6a88fbf4bcfc (diff)
parent82a8ad04d22cee5291657f2888c0899c235d3d00 (diff)
Revision: [email protected]/emacs--unicode--0--patch-16
Merge from emacs--cvs-trunk--0 Patches applied: * [email protected]/emacs--cvs-trunk--0--patch-106 - [email protected]/emacs--cvs-trunk--0--patch-110 Update from CVS * [email protected]/emacs--cvs-trunk--0--patch-111 Merge from gnus--rel--5.10 * [email protected]/emacs--cvs-trunk--0--patch-112 - [email protected]/emacs--cvs-trunk--0--patch-113 Update from CVS * [email protected]/emacs--cvs-trunk--0--patch-114 <no summary provided> * [email protected]/emacs--cvs-trunk--0--patch-115 - [email protected]/emacs--cvs-trunk--0--patch-123 Update from CVS * [email protected]/emacs--cvs-trunk--0--patch-124 Merge from gnus--rel--5.10 * [email protected]/gnus--rel--5.10--patch-17 - [email protected]/gnus--rel--5.10--patch-19 Update from CVS * [email protected]/gnus--rel--5.10--patch-20 Merge from emacs--cvs-trunk--0 * [email protected]/gnus--rel--5.10--patch-21 More work on moving images to etc/images * [email protected]/gnus--rel--5.10--patch-22 Update from CVS * [email protected]/gnus--rel--5.10--patch-23 Fix errors with image-file installation * [email protected]/gnus--rel--5.10--patch-24 etc/Makefile.in (install): Put gnus-tut.txt in the right place. * [email protected]/gnus--rel--5.10--patch-25 etc/Makefile.in (install, uninstall): Fix installed image dirs. * [email protected]/gnus--rel--5.10--patch-26 etc/Makefile.in (install): Create $(etcdir)/images/gnus dir. * [email protected]/gnus--rel--5.10--patch-27 Update from CVS
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/window.c b/src/window.c
index 370251882b..be0f47da8d 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4763,6 +4763,7 @@ window_scroll_pixel_based (window, n, whole, noerror)
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 @@ window_scroll_pixel_based (window, n, whole, noerror)
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 @@ window_scroll_pixel_based (window, n, whole, noerror)
}
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. */
{