diff options
| -rw-r--r-- | lua/clever_f/feedback_service.lua | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lua/clever_f/feedback_service.lua b/lua/clever_f/feedback_service.lua index d5b7e74..492d4a6 100644 --- a/lua/clever_f/feedback_service.lua +++ b/lua/clever_f/feedback_service.lua @@ -533,13 +533,25 @@ local function release_highlight_timer(record, identity) return record.host:stop_timer(identity) end +function FeedbackService:release_transition_cleanup(cleanup) + if type(cleanup) ~= "table" then + fail("feedback transition cleanup must be a table", 2) + end + local record = service_records[self] + release_finalizers(record, cleanup.finalizers or {}) + release_highlight_timer(record, cleanup.highlight_timer) + release_target_overlays(record, cleanup.target_overlays or {}) + if #(cleanup.finalizers or {}) > 0 then + record.owned_finalizer = nil + end + return cleanup +end + function FeedbackService:full_finalize(window) local record = service_records[self] window = window or record.host:read_window() local cleanup = record.transitions:FullFinalization(window) - release_finalizers(record, cleanup.finalizers) - release_highlight_timer(record, cleanup.highlight_timer) - release_target_overlays(record, cleanup.target_overlays) + self:release_transition_cleanup(cleanup) record.owned_finalizer = nil return cleanup end |
