Skip to content

Commit

Permalink
Use HintFmt for doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
roberth committed Jul 15, 2024
1 parent 6a125e6 commit ce31a04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/libcmd/repl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -668,12 +668,12 @@ ProcessLineResult NixRepl::processLine(std::string line)
logger->cout(trim(renderMarkdownToTerminal(markdown)));
} else if (fallbackPos) {
std::stringstream ss;
ss << "Attribute `" << fallbackName << "`\n\n";
ss << " … defined at " << state->positions[fallbackPos] << "\n\n";
ss << HintFmt("Attribute '%1%'", fallbackName) << "\n\n";
ss << HintFmt(" … defined at %1%", state->positions[fallbackPos]) << "\n\n";
if (fallbackDoc) {
ss << fallbackDoc.getInnerText(state->positions);
} else {
ss << "No documentation found.\n\n";
ss << HintFmt("No documentation found.") << "\n\n";
}

auto markdown = ss.str();
Expand Down
6 changes: 3 additions & 3 deletions src/libexpr/eval.cc
Original file line number Diff line number Diff line change
Expand Up @@ -576,17 +576,17 @@ std::optional<EvalState::Doc> EvalState::getDoc(Value & v)
}

if (name.empty()) {
s << "Function ";
s << HintFmt("Function ");
}
else {
s << "Function `" << name << "`";
s << HintFmt("Function '%s'", name);
if (pos)
s << "\\\n" ;
else
s << "\\\n";
}
if (pos) {
s << "defined at " << pos;
s << HintFmt("defined at %1%", pos);
}
if (!docStr.empty()) {
s << "\n\n";
Expand Down

0 comments on commit ce31a04

Please sign in to comment.