For unknown key binding actions we append this info to its name

This commit is contained in:
Allan Odgaard
2015-04-30 14:07:58 +02:00
parent 74ef6697ba
commit dbd33948f3

View File

@@ -694,13 +694,16 @@ static std::vector<bundles::item_ptr> relevant_items_in_scope (scope::context_t
std::string name, action;
if(std::string const* sel = boost::get<std::string>(&pair.second))
{
if(*sel == "noop:" || !seen.emplace(key, *sel).second || ![NSApp targetForAction:NSSelectorFromString([NSString stringWithCxxString:*sel])])
if(*sel == "noop:" || !seen.emplace(key, *sel).second)
continue;
action = *sel;
name = format_string::replace(*sel, "[a-z](?=[A-Z])", "$0 ");
name = format_string::replace(name, "(.+):\\z", "${1:/capitalize}");
name = format_string::replace(name, "\\bsub Word\\b", "Sub-word");
if(![NSApp targetForAction:NSSelectorFromString([NSString stringWithCxxString:*sel])])
name += " (unknown action)";
}
else
{