diff options
author | Christian Hesse <mail@eworm.de> | 2021-12-09 20:50:51 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2021-12-09 20:50:51 +0100 |
commit | 004621a327948526d3fffd4de0db1d722d68a172 (patch) | |
tree | d3316c5a8e898d4cd1e4138b545e4cab1cb837eb | |
parent | b872615e897c1cf0a0a4c6d0ccf9dd155d86ec54 (diff) |
mod/inspectvar: truncate value if too long
-rw-r--r-- | mod/inspectvar | 4 |
1 files changed, 3 insertions, 1 deletions
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; |