diff --git a/src/data/keyword.cpp b/src/data/keyword.cpp index 95df0296..8e1aa106 100644 --- a/src/data/keyword.cpp +++ b/src/data/keyword.cpp @@ -686,23 +686,18 @@ bool KeywordDatabase::tryExpand(const Keyword& kw, result += remove_tag(tagged.substr(0, start), _("toString(); - } catch (const Error& e) { - handle_error(_ERROR_2_("in keyword reminder", e.what(), kw.keyword), true, false); - } - ctx.setVariable(_("keyword"), to_script(total)); - ctx.setVariable(_("reminder"), to_script(reminder)); - result += _(""); - result += combine_script->eval(ctx)->toString(); - result += _(""); - } else { - result += _(""); - result += total; - result += _(""); + String reminder; + try { + reminder = kw.reminder.invoke(ctx)->toString(); + } catch (const Error& e) { + handle_error(_ERROR_2_("in keyword reminder", e.what(), kw.keyword), true, false); } + ctx.setVariable(_("keyword"), to_script(total)); + ctx.setVariable(_("reminder"), to_script(reminder)); + ctx.setVariable(_("expand"), to_script(expand)); + result += _(""); + result += combine_script->eval(ctx)->toString(); + result += _(""); // Add to usage statistics if (stat && stat_key) {