emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-24 r117413: Fix another part of bug #18035 with redi


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-24 r117413: Fix another part of bug #18035 with redisplay of line-prefix and linum-mode.
Date: Mon, 28 Jul 2014 13:10:02 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117413
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/18035
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-24
timestamp: Mon 2014-07-28 16:09:02 +0300
message:
  Fix another part of bug #18035 with redisplay of line-prefix and linum-mode.
  
   src/xdisp.c (display_line): If called with iterator set up to write
   to a marginal area, delay the call to handle_line_prefix until we
   switch back to the text area.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/xdisp.c                    xdisp.c-20091113204419-o5vbwnq5f7feedwu-240
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-07-28 07:18:46 +0000
+++ b/src/ChangeLog     2014-07-28 13:09:02 +0000
@@ -1,5 +1,9 @@
 2014-07-28  Eli Zaretskii  <address@hidden>
 
+       * xdisp.c (display_line): If called with iterator set up to write
+       to a marginal area, delay the call to handle_line_prefix until we
+       switch back to the text area.  (Bug#18035)
+
        * .gdbinit (xwindow): The members total_cols, total_lines,
        left_col, and top_line are C integers (and has been so for the
        last 1.5 years).

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2014-07-17 15:25:21 +0000
+++ b/src/xdisp.c       2014-07-28 13:09:02 +0000
@@ -19942,6 +19942,7 @@
   int cvpos;
   ptrdiff_t min_pos = ZV + 1, max_pos = 0;
   ptrdiff_t min_bpos IF_LINT (= 0), max_bpos IF_LINT (= 0);
+  bool pending_handle_line_prefix = false;
 
   /* We always start displaying at hpos zero even if hscrolled.  */
   eassert (it->hpos == 0 && it->current_x == 0);
@@ -20002,13 +20003,23 @@
       min_pos = CHARPOS (this_line_min_pos);
       min_bpos = BYTEPOS (this_line_min_pos);
     }
-  else
+  else if (it->area == TEXT_AREA)
     {
-      /* We only do this when not calling `move_it_in_display_line_to'
-        above, because move_it_in_display_line_to calls
-        handle_line_prefix itself.  */
+      /* We only do this when not calling move_it_in_display_line_to
+        above, because that function calls itself handle_line_prefix.  */
       handle_line_prefix (it);
     }
+  else
+    {
+      /* Line-prefix and wrap-prefix are always displayed in the text
+        area.  But if this is the first call to display_line after
+        init_iterator, the iterator might have been set up to write
+        into a marginal area, e.g. if the line begins with some
+        display property that writes to the margins.  So we need to
+        wait with the call to handle_line_prefix until whatever
+        writes to the margin has done its job.  */
+      pending_handle_line_prefix = true;
+    }
 
   /* Get the initial row height.  This is either the height of the
      text hscrolled, if there is any, or zero.  */
@@ -20140,6 +20151,14 @@
          row->extra_line_spacing = max (row->extra_line_spacing,
                                         it->max_extra_line_spacing);
          set_iterator_to_next (it, 1);
+         /* If we didn't handle the line/wrap prefix above, and the
+            call to set_iterator_to_next just switched to TEXT_AREA,
+            process the prefix now.  */
+         if (it->area == TEXT_AREA && pending_handle_line_prefix)
+           {
+             pending_handle_line_prefix = false;
+             handle_line_prefix (it);
+           }
          continue;
        }
 


reply via email to

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