emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r108884: Avoid long futile looping on


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r108884: Avoid long futile looping on a TTY under huge values of hscroll.
Date: Thu, 05 Jul 2012 19:28:34 +0300
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108884
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Thu 2012-07-05 19:28:34 +0300
message:
  Avoid long futile looping on a TTY under huge values of hscroll.
  
   src/xdisp.c (display_line): Fix horizontal pixel coordinates when
   hscroll is larger than the line width.  Fixes long and futile
   looping inside extend_face_to_end_of_line (on a TTY) producing
   glyphs that are not needed and thrown away.
modified:
  src/ChangeLog
  src/xdisp.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-07-05 16:14:39 +0000
+++ b/src/ChangeLog     2012-07-05 16:28:34 +0000
@@ -1,3 +1,10 @@
+2012-07-05  Eli Zaretskii  <address@hidden>
+
+       * xdisp.c (display_line): Fix horizontal pixel coordinates when
+       hscroll is larger than the line width.  Fixes long and futile
+       looping inside extend_face_to_end_of_line (on a TTY) producing
+       glyphs that are not needed and thrown away.
+
 2012-07-05  Dmitry Antipov  <address@hidden>
 
        * marker.c (set_marker_restricted_both): Simplify by using

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2012-07-05 15:20:12 +0000
+++ b/src/xdisp.c       2012-07-05 16:28:34 +0000
@@ -19177,9 +19177,22 @@
      if the first glyph is partially visible or if we hit a line end.  */
   if (it->current_x < it->first_visible_x)
     {
+      enum move_it_result move_result;
+
       this_line_min_pos = row->start.pos;
-      move_it_in_display_line_to (it, ZV, it->first_visible_x,
-                                 MOVE_TO_POS | MOVE_TO_X);
+      move_result = move_it_in_display_line_to (it, ZV, it->first_visible_x,
+                                               MOVE_TO_POS | MOVE_TO_X);
+      /* If we are under a large hscroll, move_it_in_display_line_to
+        could hit the end of the line without reaching
+        it->first_visible_x.  Pretend that we did reach it.  This is
+        especially important on a TTY, where we will call
+        extend_face_to_end_of_line, which needs to know how many
+        blank glyphs to produce.  */
+      if (it->current_x < it->first_visible_x
+         && (move_result == MOVE_NEWLINE_OR_CR
+             || move_result == MOVE_POS_MATCH_OR_ZV))
+       it->current_x = it->first_visible_x;
+
       /* Record the smallest positions seen while we moved over
         display elements that are not visible.  This is needed by
         redisplay_internal for optimizing the case where the cursor


reply via email to

[Prev in Thread] Current Thread [Next in Thread]