aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2014-07-04 16:22:04 +0300
committerEli Zaretskii2014-07-04 16:22:04 +0300
commit5b5953c070455773f3bdfb9ebcc7ecc15dde0611 (patch)
treec89bd472b9c0058823e7e67af1c7f6bebbe9001b /src
parentf0f34bc8b91dad77474f8f8c8d9f4bda568eaace (diff)
downloademacs-5b5953c070455773f3bdfb9ebcc7ecc15dde0611.tar.gz
emacs-5b5953c070455773f3bdfb9ebcc7ecc15dde0611.zip
Fix bug #17905 with display of point in partially visible line at end of window.
src/xdisp.c (redisplay_window): If redisplay of a window ends up with point in a partially visible line at end of the window, make sure the amended position of point actually has smaller Y coordinate; if not, give up and scroll the display. src/window.c (window_scroll_pixel_based): When point ends up at the last fully visible line, don't let move_it_to stop at the left edge of the line and dupe us into thinking point is inside the scroll margin.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/window.c26
-rw-r--r--src/xdisp.c12
3 files changed, 48 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 24343faa407..a88c6caacfd 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,15 @@
12014-07-04 Eli Zaretskii <eliz@gnu.org> 12014-07-04 Eli Zaretskii <eliz@gnu.org>
2 2
3 * xdisp.c (redisplay_window): If redisplay of a window ends up
4 with point in a partially visible line at end of the window, make
5 sure the amended position of point actually has smaller Y
6 coordinate; if not, give up and scroll the display. (Bug#17905)
7
8 * window.c (window_scroll_pixel_based): When point ends up at the
9 last fully visible line, don't let move_it_to stop at the left
10 edge of the line and dupe us into thinking point is inside the
11 scroll margin.
12
3 * w32.c (network_interface_info): Make sure the argument is a 13 * w32.c (network_interface_info): Make sure the argument is a
4 Lisp string. 14 Lisp string.
5 15
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;
diff --git a/src/xdisp.c b/src/xdisp.c
index 459edf4367f..fe5d0f579d8 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -16106,6 +16106,18 @@ redisplay_window (Lisp_Object window, bool just_this_one_p)
16106 /* Point does appear, but on a line partly visible at end of window. 16106 /* Point does appear, but on a line partly visible at end of window.
16107 Move it back to a fully-visible line. */ 16107 Move it back to a fully-visible line. */
16108 new_vpos = window_box_height (w); 16108 new_vpos = window_box_height (w);
16109 /* But if window_box_height suggests a Y coordinate that is
16110 not less than we already have, that line will clearly not
16111 be fully visible, so give up and scroll the display.
16112 This can happen when the default face uses a font whose
16113 dimensions are different from the frame's default
16114 font. */
16115 if (new_vpos >= w->cursor.y)
16116 {
16117 w->cursor.vpos = -1;
16118 clear_glyph_matrix (w->desired_matrix);
16119 goto try_to_scroll;
16120 }
16109 } 16121 }
16110 else if (w->cursor.vpos >= 0) 16122 else if (w->cursor.vpos >= 0)
16111 { 16123 {