aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/window.c b/src/window.c
index 8e8252d3b76..5e9dd0ec718 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5167,6 +5167,32 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
5167 charpos = IT_CHARPOS (it); 5167 charpos = IT_CHARPOS (it);
5168 bytepos = IT_BYTEPOS (it); 5168 bytepos = IT_BYTEPOS (it);
5169 5169
5170 /* If PT is in the screen line at the last fully visible line,
5171 move_it_to will stop at X = 0 in that line, because the
5172 required Y coordinate is reached there. See if we can get to
5173 PT without descending lower in Y, and if we can, it means we
5174 reached PT before the scroll margin. */
5175 if (charpos != PT)
5176 {
5177 struct it it2;
5178 void *it_data;
5179
5180 it2 = it;
5181 it_data = bidi_shelve_cache ();
5182 move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS);
5183 if (IT_CHARPOS (it) == PT && it.current_y == it2.current_y)
5184 {
5185 charpos = IT_CHARPOS (it);
5186 bytepos = IT_BYTEPOS (it);
5187 bidi_unshelve_cache (it_data, 1);
5188 }
5189 else
5190 {
5191 it = it2;
5192 bidi_unshelve_cache (it_data, 0);
5193 }
5194 }
5195
5170 /* See if point is on a partially visible line at the end. */ 5196 /* See if point is on a partially visible line at the end. */
5171 if (it.what == IT_EOB) 5197 if (it.what == IT_EOB)
5172 partial_p = it.current_y + it.ascent + it.descent > it.last_visible_y; 5198 partial_p = it.current_y + it.ascent + it.descent > it.last_visible_y;