about summary refs log tree commit diff
path: root/src/nix
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2018-07-27T14·52-0500
committerWill Dietz <w@wdtz.org>2018-07-27T15·45-0500
commit0d72f4e0ca3e88f3ded66112a6b157e14c2724c4 (patch)
tree6e66a6c4852500473e71602fddcb1970e27d73a2 /src/nix
parentf602ff264beafd8f7bb5a17d63c7b9412c5fc6eb (diff)
search: include version
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/search.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nix/search.cc b/src/nix/search.cc
index 4cb1efa7955b..e086de2260a6 100644
--- a/src/nix/search.cc
+++ b/src/nix/search.cc
@@ -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));
                         }
                     }