From 00f88e17cec01db6614feb18e8d04b7a1ee8e672 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sun, 23 Oct 2022 02:30:14 +0200 Subject: [PATCH] [editor] Add all template functions to highlighter Signed-off-by: Knut Ahlers --- History.md | 5 +++-- functions.go | 5 +---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/History.md b/History.md index 46d32cd..eff4956 100644 --- a/History.md +++ b/History.md @@ -11,9 +11,10 @@ * [templating] Add `jsonAPI` template function * Improvements - * ⚠ [core] Move storage to database (#30, #32) + * [core] Move storage to database (#30, #32) ⚠ * [core] Allow to pass ID to channel modification - * ⚠ [templating] Add sprig functions, replace some built-ins + * [editor] Add all template functions to highlighter + * [templating] Add sprig functions, replace some built-ins ⚠ * Bugfixes diff --git a/functions.go b/functions.go index 5fec1ce..e7d733d 100644 --- a/functions.go +++ b/functions.go @@ -63,12 +63,9 @@ func (t *templateFuncProvider) GetFuncMap(m *irc.Message, r *plugins.Rule, field } func (t *templateFuncProvider) GetFuncNames() []string { - t.lock.RLock() - defer t.lock.RUnlock() - var out []string - for n := range t.funcs { + for n := range t.GetFuncMap(nil, nil, nil) { out = append(out, n) }