-
Change Request
-
Resolution: Unresolved
-
Trivial
-
None
-
6.0.40, 7.0.12, 7.2.6
-
None
Treating newlines as whitespace between trigger functions arguments will enable multiline formatting.
Sure, it does not matter for short functions, but crowded functions involving several arguments, macros/macros overloads, being split to multiple lines, become more readable and easier to comprehend at first glance.
Consider a trigger expression example:
changecount(/Template ipset/ipset.entries[{#IPSETNAME}],{$IPSET_MISSING:"{#IPSETNAME}"},"all") = 0 and count(/Template ipset/ipset.entries[{#IPSETNAME}],#1:now-{$IPSET_MISSING:"{#IPSETNAME}"}) > 0
which could then be formatted as:
changecount( /Template ipset/ipset.entries[{#IPSETNAME}], {$IPSET_MISSING:"{#IPSETNAME}"}, "all" ) = 0 and count( /Template ipset/ipset.entries[{#IPSETNAME}], #1:now-{$IPSET_MISSING:"{#IPSETNAME}"} ) > 0
Currently, when trying to split arguments with newline, frontend errors with:
"Invalid parameter "/1/expression": incorrect expression starting from ..."
Newlines in trigger expressions are not a problem by themselves. They are already being kept as-is when editing expressions, and automatically replaced by spaces in frontend tables.