From ac2d32dd0d7f73018613bea80ebd2823508c0105 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 14:17:42 +0200 Subject: Register colorscheme highlight refresh --- lua/clever_f/composition_root.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'lua/clever_f/composition_root.lua') diff --git a/lua/clever_f/composition_root.lua b/lua/clever_f/composition_root.lua index 8d75359..527fec6 100644 --- a/lua/clever_f/composition_root.lua +++ b/lua/clever_f/composition_root.lua @@ -71,6 +71,7 @@ function CompositionRoot.new(options) coordinator = coordinator, facade = facade, activation = nil, + last_highlight_refresh = nil, } return root end @@ -82,14 +83,27 @@ end function CompositionRoot:activate() local record = root_records[self] if record.activation == nil then + local highlights = record.feedback:evaluate_highlights() + local colorscheme_registration = record.host:register_events( + "ColorScheme", + function() + record.last_highlight_refresh = record.feedback:evaluate_highlights() + end, + { owner = "clever_f", lifecycle = "colorscheme" } + ) record.activation = { state = record.state, - highlights = record.feedback:evaluate_highlights(), + highlights = highlights, + colorscheme_registration = colorscheme_registration, } end return record.activation end +function CompositionRoot:last_highlight_refresh() + return root_records[self].last_highlight_refresh +end + function CompositionRoot:host() return root_records[self].host end -- cgit v1.2.3