diff --git a/emacs/init.org b/emacs/init.org index 5dd7516..a16e276 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -2346,6 +2346,18 @@ UI-related keybindings: (format " %s" title)) (format " %s" title)) (apply oldfn tab args)))) + + ;; Add a cache to speed up icon rendering for huge groups + (defvar centaur-tabs-icon-cache (make-hash-table :test 'equal) + "A cache holding icons generated for centaur-tabs mode tabs.") + (advice-add 'centaur-tabs-icon :around + (lambda (oldfn tab face selected &rest args) + (let ((key (list tab face selected))) + (or (gethash key centaur-tabs-icon-cache) + (puthash key + (apply oldfn tab face selected args) + centaur-tabs-icon-cache))))) + :general ((normal motion visual) "g t" #'centaur-tabs-forward) ((normal motion visual) "g T" #'centaur-tabs-backward)