Skip to content

Commit

Permalink
feat(functions): Add custom buffer group
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Dec 4, 2024
1 parent 46fdeb3 commit 491b682
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions centaur-tabs-functions.el
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ buffers.")
It must return a list of group names, or nil if the buffer has no
group. Notice that it is better that a buffer belongs to one group.")

(defvar centaur-tabs-custom-buffer-groups nil
"Function that runs before any grouping logic inside the function
`centaur-tabs-buffer-groups-function'.")

(defvar centaur-tabs-adjust-buffer-order-function 'centaur-tabs-adjust-buffer-order
"Function to adjust buffer order after switch tab.
Default is `centaur-tabs-adjust-buffer-order', you can write your own rule.")
Expand Down Expand Up @@ -1340,6 +1344,8 @@ Other buffer group by `centaur-tabs-get-group-name' with project name."
((derived-mode-p 'emacs-lisp-mode) "Elisp")
((derived-mode-p 'dired-mode) "Dired")
((memq major-mode '( org-mode org-agenda-mode diary-mode)) "OrgMode")
(centaur-tabs-custom-buffer-groups
(funcall centaur-tabs-custom-buffer-groups))
(t
(centaur-tabs-get-group-name (current-buffer))))))

Expand Down

0 comments on commit 491b682

Please sign in to comment.