From 75a39ffaf1d8fb13e56d790d3902e2dbd0cabba6 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 19 Jan 2024 23:57:09 +0100 Subject: global-functions: $SymbolByUnicodeName: log warning on missing name --- global-functions.rsc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index 8552502..1109043 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1295,6 +1295,8 @@ :set SymbolByUnicodeName do={ :local Name [ :tostr $1 ]; + :global LogPrintOnce; + :local Symbols { "abacus"="\F0\9F\A7\AE"; "alarm-clock"="\E2\8F\B0"; @@ -1328,6 +1330,11 @@ "white-heavy-check-mark"="\E2\9C\85" } + :if ([ :len ($Symbols->$Name) ] = 0) do={ + $LogPrintOnce warning $0 ("No symbol available for name '" . $Name . "'!") false; + :return ""; + } + :return (($Symbols->$Name) . "\EF\B8\8F"); } -- cgit v1.2.3-70-g09d2