mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 03:04:57 +00:00
Utilities: Fix title formatting in man
`String::repeated()` returns a `ErrorOr<String>`, so wrap it in `TRY()`. This fixes a glitch in the title formatting (`{}` not removed if `ErrorOr<String>` is directly passed to `outln()`).
This commit is contained in:
parent
720d9dd683
commit
0787241cdc
1 changed files with 1 additions and 1 deletions
|
@ -98,7 +98,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
auto const title = "SerenityOS manual"_string;
|
||||
|
||||
int spaces = max(view_width / 2 - page_name.code_points().length() - section_number.code_points().length() - title.code_points().length() / 2 - 4, 0);
|
||||
outln("{}({}){}{}", page_name, section_number, String::repeated(' ', spaces), title);
|
||||
outln("{}({}){}{}", page_name, section_number, TRY(String::repeated(' ', spaces)), title);
|
||||
|
||||
auto document = Markdown::Document::parse(buffer);
|
||||
VERIFY(document);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue