]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/tab-bar.el (tab-bar-auto-width): Don't check if width changes.
authorJuri Linkov <juri@linkov.net>
Tue, 19 Sep 2023 17:51:07 +0000 (20:51 +0300)
committerJuri Linkov <juri@linkov.net>
Tue, 19 Sep 2023 17:51:07 +0000 (20:51 +0300)
Remove the condition '(< curr-width prev-width)' that was intended to check
if the width stopped to change.  But actually it's not only unneeded,
but causes a bug: when the name contains a combining character, then
the width doesn't change, and the name truncation stops too early.

lisp/tab-bar.el

index e4379b97d8be98b78719003fda6111a6f449254f..d2815c03ebf9e47ceae6b68e28099b4011d99b6e 100644 (file)
@@ -1234,8 +1234,7 @@ tab bar might wrap to the second line when it shouldn't.")
                                            space
                                            (substring name ins-pos)))
                         (setq curr-width (string-pixel-width name))
-                        (if (and (< curr-width width)
-                                 (> curr-width prev-width))
+                        (if (< curr-width width)
                             (setq prev-width curr-width
                                   prev-name name)
                           ;; Set back a shorter name
@@ -1249,8 +1248,7 @@ tab bar might wrap to the second line when it shouldn't.")
                                            (and del-pos2
                                                 (substring name del-pos2))))
                         (setq curr-width (string-pixel-width name))
-                        (if (and (> curr-width width)
-                                 (< curr-width prev-width))
+                        (if (> curr-width width)
                             (setq prev-width curr-width)
                           (setq continue nil)))
                       (let* ((len (length name))