1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-13 14:02:42 +01:00

SourceAccessor: insert colon after prefix

This allows clever editors/IDEs to discern the path more easily
for Ctrl+Click navigate to functionality, e.g. when building
.?ref=HEAD
This commit is contained in:
Robert Hensing 2024-03-14 14:23:09 +01:00 committed by Tom Bereknyei
parent ee6a764988
commit 5def18e53b

View file

@ -64,7 +64,7 @@ void SourceAccessor::setPathDisplay(std::string displayPrefix, std::string displ
std::string SourceAccessor::showPath(const CanonPath & path) std::string SourceAccessor::showPath(const CanonPath & path)
{ {
return displayPrefix + path.abs() + displaySuffix; return displayPrefix + (displayPrefix.empty() ? "" : ":") + path.rel() + displaySuffix;
} }
CanonPath SourceAccessor::resolveSymlinks( CanonPath SourceAccessor::resolveSymlinks(