Increase maximum integer length to 12 characters

This may cause overflows if the integer type is 32-bit, but we tend to use 64-bit anyway. And 9,999,999 was already an overflow too.

Fixes #12859.
This commit is contained in:
Ghostkeeper 2022-07-29 10:30:25 +02:00
parent fdad2590da
commit d27ed71518
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -153,13 +153,13 @@ SettingItem
selectionColor: UM.Theme.getColor("text_selection")
selectByMouse: true
maximumLength: (definition.type == "str" || definition.type == "[int]") ? -1 : 10
maximumLength: (definition.type == "str" || definition.type == "[int]") ? -1 : 12
// Since [int] & str don't have a max length, they need to be clipped (since clipping is expensive, this
// should be done as little as possible)
clip: definition.type == "str" || definition.type == "[int]"
validator: RegularExpressionValidator { regularExpression: (definition.type == "[int]") ? /^\[?(\s*-?[0-9]{0,9}\s*,)*(\s*-?[0-9]{0,9})\s*\]?$/ : (definition.type == "int") ? /^-?[0-9]{0,10}$/ : (definition.type == "float") ? /^-?[0-9]{0,9}[.,]?[0-9]{0,3}$/ : /^.*$/ } // definition.type property from parent loader used to disallow fractional number entry
validator: RegularExpressionValidator { regularExpression: (definition.type == "[int]") ? /^\[?(\s*-?[0-9]{0,11}\s*,)*(\s*-?[0-9]{0,11})\s*\]?$/ : (definition.type == "int") ? /^-?[0-9]{0,12}$/ : (definition.type == "float") ? /^-?[0-9]{0,11}[.,]?[0-9]{0,3}$/ : /^.*$/ } // definition.type property from parent loader used to disallow fractional number entry
Binding
{