Merge pull request #2312 from dtzWill/fix/matched-names-should-still-print-version

search: include version for matches too!
This commit is contained in:
Eelco Dolstra 2018-09-24 13:03:28 +02:00 committed by GitHub
commit 42e4ea2b6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -173,10 +173,12 @@ struct CmdSearch : SourceExprCommand, MixJSON
jsonElem.attr("description", description);
} else {
auto name = hilite(parsed.name, nameMatch, "\e[0;2m")
+ std::string(parsed.fullName, parsed.name.length());
results[attrPath] = fmt(
"* %s (%s)\n %s\n",
wrap("\e[0;1m", hilite(attrPath, attrPathMatch, "\e[0;1m")),
wrap("\e[0;2m", hilite(parsed.fullName, nameMatch, "\e[0;2m")),
wrap("\e[0;2m", hilite(name, nameMatch, "\e[0;2m")),
hilite(description, descriptionMatch, ANSI_NORMAL));
}
}