diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2010-12-04 19:32:32 -0500 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2010-12-04 19:32:32 -0500 |
commit | 77f1ed6cb665b06fc1cdd4e2707932f0b499d481 (patch) | |
tree | 4d0e035978fcfd7a27703c80314c5e61bb54964c | |
parent | 6ed96c33f0fb05488bb45fc4ed5018a0cd3e45a7 (diff) | |
download | emacs-77f1ed6cb665b06fc1cdd4e2707932f0b499d481.tar.gz |
Avoid infloop when scrolling conservatively (Bug#7537).
* src/xdisp.c (try_scrolling): Avoid infloop if the first line is obscured
due to a vscroll (Bug#7537).
-rw-r--r-- | src/ChangeLog | 5 | ||||
-rw-r--r-- | src/xdisp.c | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 025161cc395..95f7039eaf7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-12-05 Chong Yidong <cyd@stupidchicken.com> + + * xdisp.c (try_scrolling): Avoid infloop if the first line is + obscured due to a vscroll (Bug#7537). + 2010-12-02 Jan Djärv <jhd@zeplinf.localdomain> * nsterm.h (FRAME_NS_TOOLBAR_HEIGHT): Rename to FRAME_TOOLBAR_HEIGHT. diff --git a/src/xdisp.c b/src/xdisp.c index a416c8ff435..dbe3e443c67 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -12759,7 +12759,11 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, /* If cursor ends up on a partially visible line, treat that as being off the bottom of the screen. */ - if (! cursor_row_fully_visible_p (w, extra_scroll_margin_lines <= 1, 0)) + if (! cursor_row_fully_visible_p (w, extra_scroll_margin_lines <= 1, 0) + /* It's possible that the cursor is on the first line of the + buffer, which is partially obscured due to a vscroll + (Bug#7537). In that case, avoid looping forever . */ + && extra_scroll_margin_lines < w->desired_matrix->nrows - 1) { clear_glyph_matrix (w->desired_matrix); ++extra_scroll_margin_lines; |