diff options
author | Andreas Kling <kling@serenityos.org> | 2021-04-21 22:45:45 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-21 23:49:02 +0200 |
commit | 90ee84621ff18faabc0684fced8f86aef63f0ab7 (patch) | |
tree | 08bb5f2aab052eca8214d2d1e4a7f29bdc604fa7 /Userland/Libraries | |
parent | 4e6d2374b662000417aa0dbb64620ad79ffe51ce (diff) | |
download | serenity-90ee84621ff18faabc0684fced8f86aef63f0ab7.zip |
LibLine: Convert String::format() => String::formatted()
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibLine/Editor.cpp | 10 | ||||
-rw-r--r-- | Userland/Libraries/LibLine/XtermSuggestionDisplay.cpp | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibLine/Editor.cpp b/Userland/Libraries/LibLine/Editor.cpp index 8d4dfa54d5..069d0ec09d 100644 --- a/Userland/Libraries/LibLine/Editor.cpp +++ b/Userland/Libraries/LibLine/Editor.cpp @@ -1467,9 +1467,9 @@ String Style::Background::to_vt_escape() const return ""; if (m_is_rgb) { - return String::format("\033[48;2;%d;%d;%dm", m_rgb_color[0], m_rgb_color[1], m_rgb_color[2]); + return String::formatted("\e[48;2;{};{};{}m", m_rgb_color[0], m_rgb_color[1], m_rgb_color[2]); } else { - return String::format("\033[%dm", (u8)m_xterm_color + 40); + return String::formatted("\e[{}m", (u8)m_xterm_color + 40); } } @@ -1479,9 +1479,9 @@ String Style::Foreground::to_vt_escape() const return ""; if (m_is_rgb) { - return String::format("\033[38;2;%d;%d;%dm", m_rgb_color[0], m_rgb_color[1], m_rgb_color[2]); + return String::formatted("\e[38;2;{};{};{}m", m_rgb_color[0], m_rgb_color[1], m_rgb_color[2]); } else { - return String::format("\033[%dm", (u8)m_xterm_color + 30); + return String::formatted("\e[{}m", (u8)m_xterm_color + 30); } } @@ -1490,7 +1490,7 @@ String Style::Hyperlink::to_vt_escape(bool starting) const if (is_empty()) return ""; - return String::format("\033]8;;%s\033\\", starting ? m_link.characters() : ""); + return String::formatted("\e]8;;{}\e\\", starting ? m_link : String::empty()); } void Style::unify_with(const Style& other, bool prefer_other) diff --git a/Userland/Libraries/LibLine/XtermSuggestionDisplay.cpp b/Userland/Libraries/LibLine/XtermSuggestionDisplay.cpp index e10f7369ef..6831bc841f 100644 --- a/Userland/Libraries/LibLine/XtermSuggestionDisplay.cpp +++ b/Userland/Libraries/LibLine/XtermSuggestionDisplay.cpp @@ -155,7 +155,7 @@ void XtermSuggestionDisplay::display(const SuggestionManager& manager) if (m_pages.size() > 1) { auto left_arrow = page_index > 0 ? '<' : ' '; auto right_arrow = page_index < m_pages.size() - 1 ? '>' : ' '; - auto string = String::format("%c page %zu of %zu %c", left_arrow, page_index + 1, m_pages.size(), right_arrow); + auto string = String::formatted("{:c} page {} of {} {:c}", left_arrow, page_index + 1, m_pages.size(), right_arrow); if (string.length() > m_num_columns - 1) { // This would overflow into the next line, so just don't print an indicator. |