mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-26 20:55:35 +03: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
Notes:
sideshowbarker
2024-07-17 06:54:15 +09:00
Author: https://github.com/ronak69 Commit: https://github.com/SerenityOS/serenity/commit/0787241cdc Pull-request: https://github.com/SerenityOS/serenity/pull/20355 Reviewed-by: https://github.com/BertalanD ✅
@ -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…
Reference in New Issue
Block a user