mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Add proper sorting of numeric plist keys
This commit is contained in:
@@ -166,11 +166,18 @@ namespace
|
||||
return true;
|
||||
else if(rhsIter != _key_ranks.end())
|
||||
return false;
|
||||
else if(is_numeric(lhs.first) && is_numeric(rhs.first))
|
||||
return std::stol(lhs.first) < std::stol(rhs.first);
|
||||
else
|
||||
return lhs.first < rhs.first;
|
||||
}
|
||||
|
||||
private:
|
||||
static bool is_numeric (std::string const& str)
|
||||
{
|
||||
return str.find_first_not_of("0123456789") == std::string::npos;
|
||||
}
|
||||
|
||||
std::map<std::string, size_t> _key_ranks;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user