emacs-diffs
[Top][All Lists]
Advanced

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

emacs-28 6e53178a37: Avoid inflooping when 'tab-bar-format' includes emb


From: Eli Zaretskii
Subject: emacs-28 6e53178a37: Avoid inflooping when 'tab-bar-format' includes embedded newlines
Date: Sun, 2 Jan 2022 14:37:18 -0500 (EST)

branch: emacs-28
commit 6e53178a37d65218818fac3da1beac33db6ab5eb
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Avoid inflooping when 'tab-bar-format' includes embedded newlines
    
    * src/xdisp.c (tab_bar_height, redisplay_tab_bar): Support
    'tab-bar-format' with embedded newlines.  (Bug#52947)
---
 src/xdisp.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/xdisp.c b/src/xdisp.c
index 7c3885c975..73edc0d7aa 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -13508,11 +13508,15 @@ tab_bar_height (struct frame *f, int *n_rows, bool 
pixelwise)
                     0, 0, 0, STRING_MULTIBYTE (f->desired_tab_bar_string));
   it.paragraph_embedding = L2R;
 
+  clear_glyph_row (temp_row);
   while (!ITERATOR_AT_END_P (&it))
     {
-      clear_glyph_row (temp_row);
       it.glyph_row = temp_row;
       display_tab_bar_line (&it, -1);
+      /* If the tab-bar string includes newlines, get past it, because
+        display_tab_bar_line doesn't.  */
+      if (ITERATOR_AT_END_OF_LINE_P (&it))
+       set_iterator_to_next (&it, true);
     }
   clear_glyph_row (temp_row);
 
@@ -13638,6 +13642,10 @@ redisplay_tab_bar (struct frame *f)
              extra -= h;
            }
          display_tab_bar_line (&it, height + h);
+         /* If the tab-bar string includes newlines, get past it,
+            because display_tab_bar_line doesn't.  */
+         if (ITERATOR_AT_END_OF_LINE_P (&it))
+           set_iterator_to_next (&it, true);
        }
     }
   else



reply via email to

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