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

Allow customising the length at which lines are wrapped after.

Closes #485.
This commit is contained in:
Sadie Powell
2025-03-21 19:16:48 +00:00
parent 6d72fd67d8
commit ecbf53ba6c
2 changed files with 15 additions and 2 deletions
+3 -2
View File
@@ -159,11 +159,12 @@ void ListFormatter::Process(std::vector<Anope::string> &buffer)
lengths[column] = entry[column].length();
}
}
const auto max_length = Config->GetBlock("options").Get<size_t>("linelength", "120");
unsigned total_length = 0;
for (const auto &[column, length] : lengths)
{
/* Break lines at 80 chars */
if (total_length > 80)
// Break lines that are getting too long.
if (total_length > max_length)
{
breaks.insert(column);
total_length = 0;