# HG changeset patch # User jbe # Date 1389645627 -3600 # Node ID 407633fd0e84cb6e330aed8946b764b5d2b28c80 # Parent 43986d8dacf3fb25466b78bb9fbbce6be160a794 Changed default for 'truncate_count_suffix' in string.format diff -r 43986d8dacf3 -r 407633fd0e84 framework/env/format/string.lua --- a/framework/env/format/string.lua Mon Jan 13 21:37:23 2014 +0100 +++ b/framework/env/format/string.lua Mon Jan 13 21:40:27 2014 +0100 @@ -8,7 +8,7 @@ -- (currently only "codepoints" are supported and this option may be omitted) truncate_at = truncate_at, -- truncate string after the given number of UTF-8 codepoints (or Unicode grapheme clusters) truncate_suffix = truncate_suffix, -- string to append, if string was truncated (use boolean true for Unicode ellipsis) - truncate_count_suffix = truncate_count_suffix -- unless explicitly set to false, the total length (including suffix) may not exceed the given length + truncate_count_suffix = truncate_count_suffix -- if true, then the total length (including suffix) may not exceed the given length } ) @@ -89,7 +89,7 @@ elseif not truncate_suffix then truncate_suffix = '' end - if options.truncate_count_suffix ~= false and truncate_suffix then + if options.truncate_count_suffix and truncate_suffix then local suffix_length = codepoint_count(truncate_suffix) if codepoint_count(str) > options.truncate_at then return (