* lisp/tab-line.el: Fix tab-line-format and tab-line-format-template.

* lisp/tab-line.el (tab-line-format): Use buffer-name in the cache key
instead of just buffer object to invalidate the cache on buffer renaming.
(tab-line-format-template): Always leave the separator after the last tab
like tab-bar.el already does.
This commit is contained in:
Juri Linkov 2020-03-17 01:11:27 +02:00
parent a7b8291b6c
commit a2dd8c4234

View file

@ -453,9 +453,10 @@ variable `tab-line-tabs-function'."
(> (length strings) 1))
tab-line-right-button)))
(if hscroll (nthcdr (truncate hscroll) strings) strings)
(when (eq tab-line-tabs-function #'tab-line-tabs-window-buffers)
(list (concat separator (when tab-line-new-tab-choice
tab-line-new-button)))))))
(list separator)
(when (and (eq tab-line-tabs-function #'tab-line-tabs-window-buffers)
tab-line-new-tab-choice)
(list tab-line-new-button)))))
(defvar tab-line-auto-hscroll)
@ -463,7 +464,7 @@ variable `tab-line-tabs-function'."
"Template for displaying tab line for selected window."
(let* ((tabs (funcall tab-line-tabs-function))
(cache-key (list tabs
(window-buffer)
(buffer-name (window-buffer))
(window-parameter nil 'tab-line-hscroll)))
(cache (window-parameter nil 'tab-line-cache)))
;; Enable auto-hscroll again after it was disabled on manual scrolling.