From 004621a327948526d3fffd4de0db1d722d68a172 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 9 Dec 2021 20:50:51 +0100 Subject: mod/inspectvar: truncate value if too long --- mod/inspectvar | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mod/inspectvar b/mod/inspectvar index 27a47fa..c78b3f0 100644 --- a/mod/inspectvar +++ b/mod/inspectvar @@ -19,6 +19,7 @@ :local Input $1; :local Level (0 + [ :tonum $2 ]); + :global IfThenElse; :global InspectVarReturn; :local IndentReturn do={ @@ -45,7 +46,8 @@ } else={ :if ($TypeOf != "nothing") do={ :set $Return ($Return . "\n" . \ - [ $IndentReturn "value" $Input $Level ]); + [ $IndentReturn "value" [ $IfThenElse ([ :len $Input ] > 80) \ + ([ :pick $Input 0 77 ] . "...") $Input ] $Level ]); } } :return $Return; -- cgit v1.2.3-70-g09d2