Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add after-load-theme-hook
add `after-load-theme-hook` so that users may add functions that should run after a theme is loaded.  this could be useful in some cases.  in my specific case, it's to to maintain the color of the point since it is always very hard to see when the point is on an overlay like in search.
  • Loading branch information
SequentialDesign committed Dec 10, 2024
commit b283472855be6a83ebf05a44b9b969949909dc9e
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