Hard-code minimum suggestion distance to 4

This way only close matches are suggested.
This commit is contained in:
Markus Mäkelä 2018-11-07 18:50:28 +02:00
parent 809d3549ae
commit 7d54df74dc
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -5029,8 +5029,9 @@ std::string closest_matching_parameter(const std::string& str,
}
std::string rval;
const int min_dist = 4;
if (lowest < (int)std::min(str.length(), name.length()))
if (lowest <= min_dist)
{
rval = "Did you mean '" + name + "'?";
name.clear();