1
0
mirror of https://github.com/anope/anope.git synced 2026-06-27 14:26:38 +02:00

Add the monospace layout.

This works best in clients like The Lounge which use a variable-width
font but support monospace formatting.
This commit is contained in:
Sadie Powell
2025-09-20 14:56:51 +01:00
parent 03e2ebe2d2
commit a792088a62
4 changed files with 102 additions and 47 deletions
+9 -3
View File
@@ -150,6 +150,7 @@ void Command::SendSyntax(CommandSource &source)
{
const auto *sourcenc = source.GetAccount();
const auto flexible = sourcenc ? sourcenc->HasExt("NS_FLEXIBLE") : false;
const auto *monospace = !flexible && sourcenc && sourcenc->HasExt("NS_MONOSPACE") ? "\021" : "";
auto first = true;
Anope::string prefix = Language::Translate(source.GetAccount(), _("Syntax"));
@@ -162,18 +163,23 @@ void Command::SendSyntax(CommandSource &source)
if (first || flexible)
{
first = false;
source.Reply(_("%s: \002%s %s\002"), prefix.c_str(), source.command.nobreak().c_str(),
source.Reply("%s%s: \002%s %s\002", monospace, prefix.c_str(),
source.command.nobreak().c_str(),
Language::Translate(source.GetAccount(), syntax.c_str()));
}
else
{
source.Reply(_("%s \002%s %s\002"), padding.c_str(), source.command.nobreak().c_str(),
source.Reply("%s%s \002%s %s\002", monospace, padding.c_str(),
source.command.nobreak().c_str(),
Language::Translate(source.GetAccount(), syntax.c_str()));
}
}
if (first)
source.Reply(_("%s: \002%s\002"), prefix.c_str(), source.command.nobreak().c_str());
{
source.Reply("%s%s: \002%s\002", monospace, prefix.c_str(),
source.command.nobreak().c_str());
}
}
void Command::AllowUnregistered(bool b)