diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index d2815c03ebf..e21367255a0 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -1227,7 +1227,9 @@ tab-bar-auto-width ((< prev-width width) (let* ((space (apply #'propertize " " (text-properties-at 0 name))) - (ins-pos (- len (if close-p 1 0))) + (ins-pos (- len (if close-p + (length tab-bar-close-button) + 0))) (prev-name name)) (while continue (setq name (concat (substring name 0 ins-pos)