]> git.eshelyaron.com Git - emacs.git/commitdiff
Do not use tick faces beyond ZV (bug#37641)
authorJuanma Barranquero <lekktu@gmail.com>
Wed, 9 Oct 2019 10:36:57 +0000 (12:36 +0200)
committerJuanma Barranquero <lekktu@gmail.com>
Wed, 9 Oct 2019 10:37:30 +0000 (12:37 +0200)
* src/xdisp.c (maybe_produce_line_number): Check beyond_zv
before using a tick face for the line number.  Move all face
selection code outside the loop that draws the line number.

src/xdisp.c

index 1586a02e3d43c4737e16aaedc246143531b1d309..52275a11b86ec41d8cbbac9278bb4c49ba5fef3b 100644 (file)
@@ -22657,29 +22657,33 @@ maybe_produce_line_number (struct it *it)
   int width_limit =
     tem_it.last_visible_x - tem_it.first_visible_x
     - 3 * FRAME_COLUMN_WIDTH (it->f);
-  /* Produce glyphs for the line number in a scratch glyph_row.  */
-  for (const char *p = lnum_buf; *p; p++)
-    {
-      /* For continuation lines and lines after ZV, instead of a line
-        number, produce a blank prefix of the same width.  */
-      if (lnum_face_id != current_lnum_face_id
-         && (EQ (Vdisplay_line_numbers, Qvisual)
-             ? this_line == 0
-             : this_line == it->pt_lnum)
-         /* Avoid displaying the line-number-current-line face on
-            empty lines beyond EOB.  */
-         && it->what != IT_EOB)
-       tem_it.face_id = current_lnum_face_id;
-      else if (display_line_numbers_major_tick > 0
-              && (lnum_to_display % display_line_numbers_major_tick == 0))
+
+  tem_it.face_id = lnum_face_id;
+  /* Avoid displaying any face other than line-number on
+     empty lines beyond EOB.  */
+  if (lnum_face_id != current_lnum_face_id
+      && (EQ (Vdisplay_line_numbers, Qvisual)
+         ? this_line == 0
+         : this_line == it->pt_lnum)
+      && it->what != IT_EOB)
+    tem_it.face_id = current_lnum_face_id;
+  else if (!beyond_zv)
+    {
+      if (display_line_numbers_major_tick > 0
+         && (lnum_to_display % display_line_numbers_major_tick == 0))
        tem_it.face_id = merge_faces (it->w, Qline_number_major_tick,
                                      0, DEFAULT_FACE_ID);
       else if (display_line_numbers_minor_tick > 0
               && (lnum_to_display % display_line_numbers_minor_tick == 0))
        tem_it.face_id = merge_faces (it->w, Qline_number_minor_tick,
                                      0, DEFAULT_FACE_ID);
-      else
-       tem_it.face_id = lnum_face_id;
+    }
+
+  /* Produce glyphs for the line number in a scratch glyph_row.  */
+  for (const char *p = lnum_buf; *p; p++)
+    {
+      /* For continuation lines and lines after ZV, instead of a line
+        number, produce a blank prefix of the same width.  */
       if (beyond_zv
          /* Don't display the same line number more than once.  */
          || (!EQ (Vdisplay_line_numbers, Qvisual)