Skip to content

Commit

Permalink
Merge pull request #1703 from SequentialDesign/add-load-theme-hook
Browse files Browse the repository at this point in the history
add `after-load-theme-hook`
  • Loading branch information
cxxxr authored Dec 10, 2024
2 parents fdd9ec8 + b283472 commit 8fe2db6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/color-theme.lisp
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
(in-package :lem-core)

(defvar *after-load-theme-hook* '()
"For functions that should run after a theme is loaded,
for example, to maintain an attribute like CURSOR.")

(defvar *current-theme* nil)

(defun current-theme ()
Expand Down Expand Up @@ -96,7 +100,8 @@
(redraw-display :force t)
(setf (current-theme) name)
(when save-theme
(setf (config :color-theme) (current-theme)))))
(setf (config :color-theme) (current-theme))))
(run-hooks *after-load-theme-hook*))

(defun get-color-theme-color (color-theme key)
(second (assoc key (color-theme-specs color-theme))))
Expand Down
1 change: 1 addition & 0 deletions src/internal-packages.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@
(:export
:color-theme-names
:define-color-theme
:*after-load-theme-hook*
:load-theme
:current-theme
:find-color-theme
Expand Down

0 comments on commit 8fe2db6

Please sign in to comment.