diff --git a/src/string_utils.cc b/src/string_utils.cc index 2ae8ea6f..212cab2e 100644 --- a/src/string_utils.cc +++ b/src/string_utils.cc @@ -359,6 +359,11 @@ StringView format_to(ArrayView buffer, StringView fmt, ArrayView append, StringView fmt, ArrayView params) +{ + format_impl(fmt, params, append); +} + String format(StringView fmt, ArrayView params) { ByteCount size = fmt.length(); diff --git a/src/string_utils.hh b/src/string_utils.hh index 4da7ddc3..e0adc181 100644 --- a/src/string_utils.hh +++ b/src/string_utils.hh @@ -6,6 +6,7 @@ #include "vector.hh" #include "ranges.hh" #include "optional.hh" +#include "utils.hh" namespace Kakoune { @@ -161,6 +162,14 @@ StringView format_to(ArrayView buffer, StringView fmt, Types&&... params) return format_to(buffer, fmt, ArrayView{detail::format_param(std::forward(params))...}); } +void format_with(FunctionRef append, StringView fmt, ArrayView params); + +template +void format_with(FunctionRef append, StringView fmt, Types&&... params) +{ + return format_with(append, fmt, ArrayView{detail::format_param(std::forward(params))...}); +} + String double_up(StringView s, StringView characters); inline String quote(StringView s)