diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/tab-bar.el | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index ca1087e827d..cfd766d5495 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -1572,18 +1572,17 @@ happens interactively)." (let* ((tabs (funcall tab-bar-tabs-function)) (current-index (tab-bar--current-tab-index tabs)) (keep-index (if (integerp tab-number) - (1- (max 0 (min tab-number (length tabs)))) + (1- (max 1 (min tab-number (length tabs)))) current-index)) - (keep-tab (nth keep-index tabs)) (index 0)) - (when keep-tab + (when (nth keep-index tabs) (unless (eq keep-index current-index) (tab-bar-select-tab (1+ keep-index)) (setq tabs (funcall tab-bar-tabs-function))) (dolist (tab tabs) - (unless (or (eq tab keep-tab) + (unless (or (eq index keep-index) (run-hook-with-args-until-success 'tab-bar-tab-prevent-close-functions tab ;; `last-tab-p' logically can't ever be true |