]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/tab-bar.el (tab-bar-select-tab): Fix tab-bar-history-mode.
authorJuri Linkov <juri@linkov.net>
Tue, 14 Jan 2025 18:20:42 +0000 (20:20 +0200)
committerEshel Yaron <me@eshelyaron.com>
Fri, 17 Jan 2025 11:30:28 +0000 (12:30 +0100)
Reset the values of 'tab-bar-history-back' and 'tab-bar-history-forward'
to nil to not retain a previous tab's history after switching to another
tab using window-state.

(cherry picked from commit 6b71d0b1786928474741c356eb7199746f07eb62)

lisp/tab-bar.el

index 400c7a4a744431953f81d9b340810b104e53e1b1..1c6dca75d209e12be454802f95284c9a29c7319a 100644 (file)
@@ -1646,7 +1646,11 @@ Negative TAB-NUMBER counts tabs from the end of the tab bar."
           ;; `window-state-put' fails when called in the minibuffer
           (when (window-minibuffer-p)
             (select-window (get-mru-window)))
-          (window-state-put ws nil 'safe)))
+          (window-state-put ws nil 'safe)
+
+          (when tab-bar-history-mode
+            (puthash (selected-frame) nil tab-bar-history-back)
+            (puthash (selected-frame) nil tab-bar-history-forward))))
 
         (when tab-bar-select-restore-context
           (window-point-context-use))