summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2002-03-08 12:32:02 +0000
committerGerd Moellmann <gerd@gnu.org>2002-03-08 12:32:02 +0000
commite0d9e23de94891d7946c57ad6a3a06cb4dd3bd62 (patch)
tree47783d2b3c989d50c9aca9f5f42d37eeb1fabefc
parent934add430e73c86f03c03e0d46f433cde445bd70 (diff)
downloademacs-e0d9e23de94891d7946c57ad6a3a06cb4dd3bd62.tar.gz
(move_it_vertically_backward): At the end of the
function, when moving forward by lines, treat terminal frames specially.
-rw-r--r--src/ChangeLog6
-rw-r--r--src/xdisp.c20
2 files changed, 22 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 6059351bb37..8c5494fb09e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2002-03-08 Gerd Moellmann <gerd@gnu.org>
+
+ * xdisp.c (move_it_vertically_backward): At the end of the
+ function, when moving forward by lines, treat terminal frames
+ specially.
+
2002-02-23 Eli Zaretskii <eliz@is.elta.co.il>
* coding.h (run_pre_post_conversion_on_str): Add prototype.
diff --git a/src/xdisp.c b/src/xdisp.c
index 9da2426a93c..eb4070078a5 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -5396,12 +5396,24 @@ move_it_vertically_backward (it, dy)
else if (target_y >= it->current_y + line_height
&& IT_CHARPOS (*it) < ZV)
{
- /* Should move forward by at least one line, maybe more. */
- do
+ /* Should move forward by at least one line, maybe more.
+
+ Note: Calling move_it_by_lines can be expensive on
+ terminal frames, where compute_motion is used (via
+ vmotion) to do the job, when there are very long lines
+ and truncate-lines is nil. That's the reason for
+ treating terminal frames specially here. */
+
+ if (!FRAME_WINDOW_P (it->f))
+ move_it_vertically (it, target_y - (it->current_y + line_height));
+ else
{
- move_it_by_lines (it, 1, 1);
+ do
+ {
+ move_it_by_lines (it, 1, 1);
+ }
+ while (target_y >= line_bottom_y (it) && IT_CHARPOS (*it) < ZV);
}
- while (target_y >= line_bottom_y (it) && IT_CHARPOS (*it) < ZV);
xassert (IT_CHARPOS (*it) >= BEGV);
}